build: Fix emscripten build using MSVC style flags

This commit is contained in:
doyle 2023-11-26 16:03:53 +11:00
parent 20d7b7763b
commit f176d66058

View File

@ -538,7 +538,7 @@ int main(int argc, char const **argv)
// NOTE: Setup build context ===========================================================
Dqn_FArray32<Dqn_Str8> emscripten_obj_files = {};
Dqn_CPPBuildContext raylib_emscripten_build_context = {};
raylib_emscripten_build_context.flags_style = flags_style;
raylib_emscripten_build_context.flags_style = Dqn_CPPBuildFlagsStyle_GCC;
for (Dqn_Str8 base_file : raylib_base_files) {
Dqn_Str8 file_stem = Dqn_Str8_FileNameNoExtension(base_file);
@ -669,16 +669,20 @@ int main(int argc, char const **argv)
}
// NOTE: Compile with emcc =============================================================
Dqn_CPPBuildContext build_context = {};
build_context.compile_file_obj_suffix = DQN_CPP_BUILD_OBJ_SUFFIX_O;
build_context.compile_files = Dqn_Slice_InitCArray(scratch.arena, {
Dqn_CPPBuildCompileFile{{}, {}, Dqn_FsPath_ConvertF(scratch.arena, "%.*s/feely_pona_unity.cpp", DQN_STR_FMT(code_dir)) },
});
Dqn_Str8 output_name = DQN_STR8("Terry_Cherry");
Dqn_CPPBuildCompileFile build_file = {};
build_file.prefix_flags = Dqn_Slice_InitCArray(scratch.arena, {DQN_STR8("-xc++")});
build_file.suffix_flags = Dqn_Slice_InitCArray(scratch.arena, {DQN_STR8("-xnone")});
build_file.input_file_path = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/feely_pona_unity.cpp", DQN_STR_FMT(code_dir));
build_file.output_file_path = Dqn_Str8_InitF(scratch.allocator, "%.*s.html", DQN_STR_FMT(output_name));
Dqn_CPPBuildContext build_context = {};
build_context.flags_style = Dqn_CPPBuildFlagsStyle_GCC;
build_context.compile_file_obj_suffix = DQN_CPP_BUILD_OBJ_SUFFIX_O;
build_context.compile_files = Dqn_Slice_Init(&build_file, 1);
Dqn_Str8 output_name = DQN_STR8("Terry_Cherry");
Dqn_FArray32<Dqn_Str8> compile_flags = Dqn_FArray_InitCArray<Dqn_Str8, 32>({
DQN_STR8("cmd"), DQN_STR8("/C"), DQN_STR8("emcc.bat"),
DQN_STR8("-o"), Dqn_Str8_InitF(scratch.allocator, "%.*s.html", DQN_STR_FMT(output_name)),
DQN_STR8("-Wall"),
DQN_STR8("--shell-file"), html_shell_path,
Dqn_FsPath_ConvertF(scratch.arena, "%.*s/%.*s", DQN_STR_FMT(build_dir), DQN_STR_FMT(raylib_emscripten_lib_name)),