build: Fix compile errors on Windows from Linux changes
This commit is contained in:
		
							parent
							
								
									05788cc726
								
							
						
					
					
						commit
						20d7b7763b
					
				
							
								
								
									
										2
									
								
								External/tely
									
									
									
									
										vendored
									
									
								
							
							
								
								
								
								
								
								
									
									
								
							
						
						
									
										2
									
								
								External/tely
									
									
									
									
										vendored
									
									
								
							| @ -1 +1 @@ | ||||
| Subproject commit f6b969cf9205d939f8b5d4d05d41026be98e82ac | ||||
| Subproject commit 2cc8b2d7b2a255eccad747ea6a91187093eb64f7 | ||||
| @ -1,5 +1,5 @@ | ||||
| @echo off | ||||
| setlocal | ||||
| 
 | ||||
| call build_all.bat %* --fast-dev-build || exit /b 1 | ||||
| call build_all.bat %* || exit /b 1 | ||||
| 
 | ||||
|  | ||||
| @ -245,7 +245,10 @@ static void FP_PlayReset(FP_Game *game, TELY_OS *os) | ||||
|     } | ||||
| 
 | ||||
|     // NOTE: Fisher yates shuffle the list
 | ||||
|     DQN_MSVC_WARNING_PUSH | ||||
|     DQN_MSVC_WARNING_DISABLE(6293) // Ill-formed for loop (potential wrapping index)
 | ||||
|     for (Dqn_usize index = DQN_ARRAY_UCOUNT(play->monkey_spawn_shuffled_list) - 1; index < DQN_ARRAY_UCOUNT(play->monkey_spawn_shuffled_list); index--) { | ||||
|     DQN_MSVC_WARNING_POP | ||||
|         uint32_t swap_index = Dqn_PCG32_Range(&play->rng, 0, DQN_CAST(uint32_t)index + 1); | ||||
|         DQN_SWAP(play->monkey_spawn_shuffled_list[swap_index], play->monkey_spawn_shuffled_list[index]); | ||||
|     } | ||||
|  | ||||
| @ -49,7 +49,7 @@ void RebuildProgramIfRequired(int argc, char const **argv) | ||||
|     } | ||||
| 
 | ||||
|     // NOTE: Rebuild the build program because a change was detected ===============
 | ||||
|     Dqn_Str8 rebuild_cmd = Dqn_Str8_InitF(scratch.allocator, "cl /Z7 /W4 /nologo %s /incremental:no /link", __FILE__); | ||||
|     Dqn_Str8 rebuild_cmd = Dqn_Str8_InitF(scratch.allocator, "cl -Z7 -W4 -nologo %s /incremental:no /link", __FILE__); | ||||
|     Dqn_OSExecResult rebuild_result = Dqn_OS_Exec(rebuild_cmd, exe_dir /*working_dir*/); | ||||
|     if (rebuild_result.os_error_code) { | ||||
|         Dqn_WinError error = Dqn_Win_LastError(scratch.arena); | ||||
| @ -146,14 +146,14 @@ int main(int argc, char const **argv) | ||||
|     Dqn_FArray32<Dqn_Str8> common_link_flags    = {}; | ||||
|     if (windows_build) { | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("cl")); | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("/W4")); | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("/Z7")); | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("/MT")); | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("/EHsc")); | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("/nologo")); | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("-W4")); | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("-Z7")); | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("-MT")); | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("-EHsc")); | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("-nologo")); | ||||
| 
 | ||||
|         Dqn_FArray_AddAssert(&common_link_flags,    DQN_STR8("/link")); | ||||
|         Dqn_FArray_AddAssert(&common_link_flags,    DQN_STR8("/incremental:no")); | ||||
|         Dqn_FArray_AddAssert(&common_link_flags,    DQN_STR8("-link")); | ||||
|         Dqn_FArray_AddAssert(&common_link_flags,    DQN_STR8("-incremental:no")); | ||||
|     } else { | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("g++")); | ||||
|         Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("-Wall")); | ||||
| @ -170,13 +170,18 @@ int main(int argc, char const **argv) | ||||
| 
 | ||||
|         Dqn_FArray8<Dqn_Str8> common_copy_cmd_args = {}; | ||||
|         if (windows_build) { | ||||
|             Dqn_FArray_AddAssert(&common_copy_cmd_args, DQN_STR8("robocopy")); | ||||
|             Dqn_FArray_AddAssert(&common_copy_cmd_args, DQN_STR8("/NJH")); | ||||
|             Dqn_FArray_AddAssert(&common_copy_cmd_args, DQN_STR8("/NDL")); | ||||
|             Dqn_FArray_AddAssert(&common_copy_cmd_args, DQN_STR8("/NP")); | ||||
|             Dqn_FArray_AddCArrayAssert(&common_copy_cmd_args, { | ||||
|                 DQN_STR8("robocopy"), | ||||
|                 DQN_STR8("/NJH"), | ||||
|                 DQN_STR8("/NJS"), | ||||
|                 DQN_STR8("/NDL"), | ||||
|                 DQN_STR8("/NP"), | ||||
|             }); | ||||
|         } else { | ||||
|             Dqn_FArray_AddAssert(&common_copy_cmd_args, DQN_STR8("cp")); | ||||
|             Dqn_FArray_AddAssert(&common_copy_cmd_args, DQN_STR8("--recursive")); | ||||
|             Dqn_FArray_AddCArrayAssert(&common_copy_cmd_args, { | ||||
|                 DQN_STR8("cp"), | ||||
|                 DQN_STR8("--recursive"), | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         Dqn_Str8 textures_dest = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/Data/Textures", DQN_STR_FMT(build_dir)); | ||||
| @ -222,11 +227,15 @@ int main(int argc, char const **argv) | ||||
| 
 | ||||
|         for (Dqn_FArray8<Dqn_Str8> const ©_cmd : copy_cmd_list) { | ||||
|             Dqn_Slice<Dqn_Str8> copy_cmd_slice = Dqn_FArray_Slice(©_cmd); | ||||
|             if (dry_run) { | ||||
|                 Dqn_Str8 rendered_line             = Dqn_Slice_Str8Render(scratch.arena, copy_cmd_slice, DQN_STR8(" ")); | ||||
|                 Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(rendered_line)); | ||||
|             } else { | ||||
|                 Dqn_OS_ExecOrAbort(copy_cmd_slice, /*working_dir*/ {}); | ||||
|             Dqn_Str8 rendered_line             = Dqn_Slice_Str8Render(scratch.arena, copy_cmd_slice, DQN_STR8(" ")); | ||||
|             Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(rendered_line)); | ||||
|             if (!dry_run) { | ||||
|                 if (windows_build) { | ||||
|                     // NOTE: Robocopy returns 1 on success so we don't use the ExecOrAbort function
 | ||||
|                     Dqn_OS_Exec(copy_cmd_slice, /*working_dir*/ {}); | ||||
|                 } else { | ||||
|                     Dqn_OS_ExecOrAbort(copy_cmd_slice, /*working_dir*/ {}); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| @ -253,30 +262,34 @@ int main(int argc, char const **argv) | ||||
|         Dqn_FArray32<Dqn_Str8> compile_flags = {}; | ||||
|         Dqn_CPPBuildContext build_context = {}; | ||||
|         { | ||||
|             build_context.include_dirs  = Dqn_Slice_InitCArray(scratch.arena, { | ||||
|             build_context.include_dirs = Dqn_Slice_InitCArray(scratch.arena, { | ||||
|                 Dqn_FsPath_ConvertF(scratch.arena, "%.*s", DQN_STR_FMT(raylib_dir)), | ||||
|                 Dqn_FsPath_ConvertF(scratch.arena, "%.*s/external/glfw/include", DQN_STR_FMT(raylib_dir)), | ||||
|                 Dqn_FsPath_ConvertF(scratch.arena, "%.*s/glfw/deps/mingw", DQN_STR_FMT(raylib_dir)), | ||||
|             }); | ||||
| 
 | ||||
|             if (windows_build) { | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("cl")); | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("/w")); | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("/c")); | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("/D _DEFAULT_SOURCE")); | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("/D PLATFORM_DESKTOP")); | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("/Z7")); | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("/MT")); | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("/EHsc")); | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("/nologo")); | ||||
|                 Dqn_FArray_AddCArrayAssert(&compile_flags, { | ||||
|                     DQN_STR8("cl"), | ||||
|                     DQN_STR8("-w"), | ||||
|                     DQN_STR8("-Z7"), | ||||
|                     DQN_STR8("-MT"), | ||||
|                     DQN_STR8("-EHsc"), | ||||
|                     DQN_STR8("-nologo"), | ||||
|                 }); | ||||
|             } else { | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("gcc")); | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("-c")); | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("-D _DEFAULT_SOURCE")); | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("-D PLATFORM_DESKTOP")); | ||||
|                 Dqn_FArray_Add(&compile_flags, DQN_STR8("-g")); | ||||
|                 Dqn_FArray_AddCArrayAssert(&compile_flags, { | ||||
|                     DQN_STR8("gcc"), | ||||
|                     DQN_STR8("-g"), | ||||
|                 }); | ||||
|             } | ||||
| 
 | ||||
|             Dqn_FArray_AddCArrayAssert(&compile_flags, { | ||||
|                 DQN_STR8("-c"), // Compile object files only
 | ||||
|                 DQN_STR8("-D"), DQN_STR8("_DEFAULT_SOURCE"), | ||||
|                 DQN_STR8("-D"), DQN_STR8("PLATFORM_DESKTOP"), | ||||
|             }); | ||||
| 
 | ||||
|             build_context.build_dir     = build_dir; | ||||
|             build_context.compile_flags = Dqn_FArray_Slice(&compile_flags); | ||||
|             build_context.flags_style   = flags_style; | ||||
| @ -292,12 +305,10 @@ int main(int argc, char const **argv) | ||||
|             build_context.compile_files        = Dqn_Slice_Init(&build_file, 1); | ||||
|             Dqn_FArray_AddAssert(&raylib_pc_output_files, build_file.output_file_path); | ||||
| 
 | ||||
|             if (dry_run) { | ||||
|                 Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|                 Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd)); | ||||
|             } else { | ||||
|             Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|             Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd)); | ||||
|             if (!dry_run) | ||||
|                 Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         // NOTE: Build rlgfw =======================================================================
 | ||||
| @ -308,12 +319,10 @@ int main(int argc, char const **argv) | ||||
|             build_context.compile_files        = Dqn_Slice_InitCArray(scratch.arena, {build_file}); | ||||
|             Dqn_FArray_AddAssert(&raylib_pc_output_files, build_file.output_file_path); | ||||
| 
 | ||||
|             if (dry_run) { | ||||
|                 Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|                 Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd)); | ||||
|             } else { | ||||
|             Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|             Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd)); | ||||
|             if (!dry_run) | ||||
|                 Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| @ -339,21 +348,15 @@ int main(int argc, char const **argv) | ||||
|         Dqn_FArray_AddAssert(&sokol_audio_pc_output_files, Dqn_Str8_InitF(scratch.allocator, "sokol_audio.%s", windows_build ? "obj" : "o")); | ||||
| 
 | ||||
|         Dqn_FArray32<Dqn_Str8> compile_flags = common_compile_flags; | ||||
|         if (windows_build) { | ||||
|             Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/c")); | ||||
|         } else { | ||||
|             Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("-c")); | ||||
|         } | ||||
|         Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("-c")); | ||||
| 
 | ||||
|         build_context.compile_flags = Dqn_FArray_Slice(&compile_flags); | ||||
|         build_context.build_dir     = build_dir; | ||||
| 
 | ||||
|         if (dry_run) { | ||||
|             Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|             Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd)); | ||||
|         } else { | ||||
|         Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|         Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd)); | ||||
|         if (!dry_run) | ||||
|             Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     // NOTE: Feely Pona Sprite Packer ==============================================================
 | ||||
| @ -372,12 +375,10 @@ int main(int argc, char const **argv) | ||||
|         build_context.link_flags    = Dqn_FArray_Slice(&common_link_flags); | ||||
|         build_context.build_dir     = build_dir; | ||||
| 
 | ||||
|         if (dry_run) { | ||||
|             Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|             Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd)); | ||||
|         } else { | ||||
|         Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|         Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd)); | ||||
|         if (!dry_run) | ||||
|             Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     // NOTE: Feely Pona Link Flags =================================================================
 | ||||
| @ -413,20 +414,17 @@ int main(int argc, char const **argv) | ||||
|         build_file.input_file_path         = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/feely_pona_unity.h", DQN_STR_FMT(code_dir)); | ||||
|         build_file.output_file_path        = Dqn_FsPath_ConvertF(scratch.arena, "terry_cherry"); | ||||
|         if (windows_build) { | ||||
|             build_file.prefix_flags = Dqn_Slice_InitCArray(scratch.arena, {DQN_STR8("/Tp")}); | ||||
|             build_file.prefix_flags = Dqn_Slice_InitCArray(scratch.arena, {DQN_STR8("-Tp")}); | ||||
|         } else { | ||||
|             build_file.prefix_flags = Dqn_Slice_InitCArray(scratch.arena, {DQN_STR8("-xc++")}); | ||||
|             build_file.suffix_flags = Dqn_Slice_InitCArray(scratch.arena, {DQN_STR8("-xnone")}); | ||||
|         } | ||||
| 
 | ||||
|         Dqn_FArray32<Dqn_Str8> compile_flags = common_compile_flags; | ||||
|         if (windows_build) { | ||||
|             Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/D TELY_WITH_PLATFORM")); | ||||
|             Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/D FEELY_PONA_IMPLEMENTATION")); | ||||
|         } else { | ||||
|             Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("-D TELY_WITH_PLATFORM")); | ||||
|             Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("-D FEELY_PONA_IMPLEMENTATION")); | ||||
|         } | ||||
|         Dqn_FArray_AddCArrayAssert(&compile_flags, { | ||||
|             DQN_STR8("-D"), DQN_STR8("TELY_WITH_PLATFORM"), | ||||
|             DQN_STR8("-D"), DQN_STR8("FEELY_PONA_IMPLEMENTATION"), | ||||
|         }); | ||||
| 
 | ||||
|         Dqn_CPPBuildContext feely_pona_no_dll_build_context = {}; | ||||
|         feely_pona_no_dll_build_context.flags_style         = flags_style; | ||||
| @ -436,12 +434,10 @@ int main(int argc, char const **argv) | ||||
|         feely_pona_no_dll_build_context.build_dir           = build_dir; | ||||
|         feely_pona_no_dll_build_context.link_flags          = Dqn_FArray_Slice(&feely_pona_platform_link_flags); | ||||
| 
 | ||||
|         if (dry_run) { | ||||
|             Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(feely_pona_no_dll_build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|             Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd)); | ||||
|         } else { | ||||
|         Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(feely_pona_no_dll_build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|         Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd)); | ||||
|         if (!dry_run) | ||||
|             Dqn_CPPBuild_ExecOrAbort(feely_pona_no_dll_build_context, Dqn_CPPBuildMode_AlwaysRebuild); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     // NOTE: Feely Pona DLL ========================================================================
 | ||||
| @ -453,13 +449,13 @@ int main(int argc, char const **argv) | ||||
|         Dqn_CPPBuildCompileFile build_file = {}; | ||||
|         build_file.input_file_path         = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/feely_pona_unity.h", DQN_STR_FMT(code_dir)); | ||||
|         build_file.output_file_path        = Dqn_FsPath_ConvertF(scratch.arena, "terry_cherry_dev_dll"); | ||||
|         build_file.prefix_flags            = Dqn_Slice_InitCArray(scratch.arena, {DQN_STR8("/Tp")}); | ||||
|         build_file.prefix_flags            = Dqn_Slice_InitCArray(scratch.arena, {DQN_STR8("-Tp")}); | ||||
| 
 | ||||
|         Dqn_FArray32<Dqn_Str8> compile_flags = common_compile_flags; | ||||
|         Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/LD")); | ||||
|         Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/D FEELY_PONA_IMPLEMENTATION")); | ||||
|         Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("-LD")); | ||||
|         Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("-D FEELY_PONA_IMPLEMENTATION")); | ||||
|         if (!dev_fast_build) | ||||
|             Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/analyze")); | ||||
|             Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("-analyze")); | ||||
| 
 | ||||
|         Dqn_CPPBuildContext build_context = {}; | ||||
|         build_context.flags_style         = flags_style; | ||||
| @ -468,12 +464,10 @@ int main(int argc, char const **argv) | ||||
|         build_context.link_flags          = {}; | ||||
|         build_context.build_dir           = build_dir; | ||||
| 
 | ||||
|         if (dry_run) { | ||||
|             Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|             Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd)); | ||||
|         } else { | ||||
|         Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|         Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd)); | ||||
|         if (!dry_run) | ||||
|             Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_AlwaysRebuild); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     // NOTE: Feely Pona platform ===================================================================
 | ||||
| @ -485,11 +479,13 @@ int main(int argc, char const **argv) | ||||
|         Dqn_CPPBuildCompileFile build_file = {}; | ||||
|         build_file.input_file_path         = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/feely_pona_unity.h", DQN_STR_FMT(code_dir)); | ||||
|         build_file.output_file_path        = Dqn_FsPath_ConvertF(scratch.arena, "terry_cherry_dev", DQN_STR_FMT(code_dir)); | ||||
|         build_file.prefix_flags            = Dqn_Slice_InitCArray(scratch.arena, {DQN_STR8("/Tp")}); | ||||
|         build_file.prefix_flags            = Dqn_Slice_InitCArray(scratch.arena, {DQN_STR8("-Tp")}); | ||||
| 
 | ||||
|         Dqn_FArray32<Dqn_Str8> compile_flags = common_compile_flags; | ||||
|         Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/D TELY_WITH_PLATFORM")); | ||||
|         Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/D TELY_WITH_PLATFORM_DLL")); | ||||
|         Dqn_FArray_AddCArrayAssert(&compile_flags, { | ||||
|             DQN_STR8("-D"), DQN_STR8("TELY_WITH_PLATFORM"), | ||||
|             DQN_STR8("-D"), DQN_STR8("TELY_WITH_PLATFORM_DLL"), | ||||
|         }); | ||||
| 
 | ||||
|         Dqn_CPPBuildContext build_context = {}; | ||||
|         build_context.flags_style         = flags_style; | ||||
| @ -499,10 +495,9 @@ int main(int argc, char const **argv) | ||||
|         build_context.build_dir           = build_dir; | ||||
|         build_context.include_dirs        = Dqn_Slice_InitCArray(scratch.arena, {raylib_dir}); | ||||
| 
 | ||||
|         if (dry_run) { | ||||
|             Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|             Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd)); | ||||
|         } else { | ||||
|         Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|         Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd)); | ||||
|         if (!dry_run) { | ||||
|             Dqn_Str8 exe_path = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/terry_cherry_dev.exe", DQN_STR_FMT(build_dir)); | ||||
|             bool exe_is_locked   = false; | ||||
|             if (Dqn_Fs_Exists(exe_path)) { | ||||
| @ -571,12 +566,10 @@ int main(int argc, char const **argv) | ||||
|                 raylib_emscripten_build_context.build_dir     = build_dir; | ||||
|                 Dqn_FArray_AddAssert(&emscripten_obj_files, build_file.output_file_path); | ||||
| 
 | ||||
|                 if (dry_run) { | ||||
|                     Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(raylib_emscripten_build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|                     Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd)); | ||||
|                 } else { | ||||
|                 Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(raylib_emscripten_build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|                 Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd)); | ||||
|                 if (!dry_run) | ||||
|                     Dqn_CPPBuild_ExecOrAbort(raylib_emscripten_build_context, Dqn_CPPBuildMode_CacheBuild); | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             { | ||||
| @ -602,12 +595,10 @@ int main(int argc, char const **argv) | ||||
|                 raylib_emscripten_build_context.build_dir     = build_dir; | ||||
|                 Dqn_FArray_AddAssert(&emscripten_obj_files, build_file.output_file_path); | ||||
| 
 | ||||
|                 if (dry_run) { | ||||
|                     Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(raylib_emscripten_build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|                     Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd)); | ||||
|                 } else { | ||||
|                 Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(raylib_emscripten_build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|                 Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd)); | ||||
|                 if (!dry_run) | ||||
|                     Dqn_CPPBuild_ExecOrAbort(raylib_emscripten_build_context, Dqn_CPPBuildMode_CacheBuild); | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             // NOTE: Build the wasm raylib+sokol_audio library =====================================
 | ||||
| @ -622,12 +613,11 @@ int main(int argc, char const **argv) | ||||
| 
 | ||||
|                 Dqn_FArray_AddArrayAssert(&cmd_args, emscripten_obj_files.data, emscripten_obj_files.size); | ||||
|                 Dqn_Slice<Dqn_Str8> cmd_slice = Dqn_FArray_Slice(&cmd_args); | ||||
|                 if (dry_run) { | ||||
|                     Dqn_Str8 cmd = Dqn_Slice_Str8Render(scratch.arena, cmd_slice, DQN_STR8(" ") /*separator*/); | ||||
|                     Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd)); | ||||
|                 } else { | ||||
| 
 | ||||
|                 Dqn_Str8 cmd = Dqn_Slice_Str8Render(scratch.arena, cmd_slice, DQN_STR8(" ") /*separator*/); | ||||
|                 Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd)); | ||||
|                 if (!dry_run) | ||||
|                     Dqn_OS_ExecOrAbort(cmd_slice, build_dir); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
| @ -707,12 +697,10 @@ int main(int argc, char const **argv) | ||||
|             build_context.compile_flags = Dqn_FArray_Slice(&compile_flags); | ||||
|             build_context.build_dir     = build_dir; | ||||
| 
 | ||||
|             if (dry_run) { | ||||
|                 Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|                 Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd)); | ||||
|             } else { | ||||
|             Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena); | ||||
|             Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd)); | ||||
|             if (!dry_run) | ||||
|                 Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild); | ||||
|             } | ||||
| 
 | ||||
|             // NOTE: Move the files to a directory
 | ||||
|             Dqn_Str8 folder_path = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/%.*s", DQN_STR_FMT(build_dir), DQN_STR_FMT(output_name)); | ||||
| @ -743,12 +731,10 @@ int main(int argc, char const **argv) | ||||
|                 Dqn_FArray_AddAssert(&cmd_args, dest_path); | ||||
| 
 | ||||
|                 Dqn_Slice<Dqn_Str8> cmd_slice = Dqn_FArray_Slice(&cmd_args); | ||||
|                 if (dry_run) { | ||||
|                     Dqn_Str8 cmd_rendered = Dqn_Slice_Str8Render(scratch.arena, cmd_slice, DQN_STR8(" ")); | ||||
|                     Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd_rendered)); | ||||
|                 } else { | ||||
|                 Dqn_Str8 cmd_rendered = Dqn_Slice_Str8Render(scratch.arena, cmd_slice, DQN_STR8(" ")); | ||||
|                 Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd_rendered)); | ||||
|                 if (!dry_run) | ||||
|                     Dqn_OS_ExecOrAbort(cmd_slice, build_dir); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user