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
|
@echo off
|
||||||
setlocal
|
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
|
// 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--) {
|
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);
|
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]);
|
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 ===============
|
// 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*/);
|
Dqn_OSExecResult rebuild_result = Dqn_OS_Exec(rebuild_cmd, exe_dir /*working_dir*/);
|
||||||
if (rebuild_result.os_error_code) {
|
if (rebuild_result.os_error_code) {
|
||||||
Dqn_WinError error = Dqn_Win_LastError(scratch.arena);
|
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 = {};
|
Dqn_FArray32<Dqn_Str8> common_link_flags = {};
|
||||||
if (windows_build) {
|
if (windows_build) {
|
||||||
Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("cl"));
|
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("-W4"));
|
||||||
Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("/Z7"));
|
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("-MT"));
|
||||||
Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("/EHsc"));
|
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("-nologo"));
|
||||||
|
|
||||||
Dqn_FArray_AddAssert(&common_link_flags, DQN_STR8("/link"));
|
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("-incremental:no"));
|
||||||
} else {
|
} else {
|
||||||
Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("g++"));
|
Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("g++"));
|
||||||
Dqn_FArray_AddAssert(&common_compile_flags, DQN_STR8("-Wall"));
|
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 = {};
|
Dqn_FArray8<Dqn_Str8> common_copy_cmd_args = {};
|
||||||
if (windows_build) {
|
if (windows_build) {
|
||||||
Dqn_FArray_AddAssert(&common_copy_cmd_args, DQN_STR8("robocopy"));
|
Dqn_FArray_AddCArrayAssert(&common_copy_cmd_args, {
|
||||||
Dqn_FArray_AddAssert(&common_copy_cmd_args, DQN_STR8("/NJH"));
|
DQN_STR8("robocopy"),
|
||||||
Dqn_FArray_AddAssert(&common_copy_cmd_args, DQN_STR8("/NDL"));
|
DQN_STR8("/NJH"),
|
||||||
Dqn_FArray_AddAssert(&common_copy_cmd_args, DQN_STR8("/NP"));
|
DQN_STR8("/NJS"),
|
||||||
|
DQN_STR8("/NDL"),
|
||||||
|
DQN_STR8("/NP"),
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Dqn_FArray_AddAssert(&common_copy_cmd_args, DQN_STR8("cp"));
|
Dqn_FArray_AddCArrayAssert(&common_copy_cmd_args, {
|
||||||
Dqn_FArray_AddAssert(&common_copy_cmd_args, DQN_STR8("--recursive"));
|
DQN_STR8("cp"),
|
||||||
|
DQN_STR8("--recursive"),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Dqn_Str8 textures_dest = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/Data/Textures", DQN_STR_FMT(build_dir));
|
Dqn_Str8 textures_dest = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/Data/Textures", DQN_STR_FMT(build_dir));
|
||||||
@ -222,14 +227,18 @@ int main(int argc, char const **argv)
|
|||||||
|
|
||||||
for (Dqn_FArray8<Dqn_Str8> const ©_cmd : copy_cmd_list) {
|
for (Dqn_FArray8<Dqn_Str8> const ©_cmd : copy_cmd_list) {
|
||||||
Dqn_Slice<Dqn_Str8> copy_cmd_slice = Dqn_FArray_Slice(©_cmd);
|
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_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));
|
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 {
|
} else {
|
||||||
Dqn_OS_ExecOrAbort(copy_cmd_slice, /*working_dir*/ {});
|
Dqn_OS_ExecOrAbort(copy_cmd_slice, /*working_dir*/ {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE: Raylib ================================================================================
|
// NOTE: Raylib ================================================================================
|
||||||
Dqn_Str8 const raylib_dir = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/External/tely/External/raylib", DQN_STR_FMT(exe_dir));
|
Dqn_Str8 const raylib_dir = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/External/tely/External/raylib", DQN_STR_FMT(exe_dir));
|
||||||
@ -260,23 +269,27 @@ int main(int argc, char const **argv)
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (windows_build) {
|
if (windows_build) {
|
||||||
Dqn_FArray_Add(&compile_flags, DQN_STR8("cl"));
|
Dqn_FArray_AddCArrayAssert(&compile_flags, {
|
||||||
Dqn_FArray_Add(&compile_flags, DQN_STR8("/w"));
|
DQN_STR8("cl"),
|
||||||
Dqn_FArray_Add(&compile_flags, DQN_STR8("/c"));
|
DQN_STR8("-w"),
|
||||||
Dqn_FArray_Add(&compile_flags, DQN_STR8("/D _DEFAULT_SOURCE"));
|
DQN_STR8("-Z7"),
|
||||||
Dqn_FArray_Add(&compile_flags, DQN_STR8("/D PLATFORM_DESKTOP"));
|
DQN_STR8("-MT"),
|
||||||
Dqn_FArray_Add(&compile_flags, DQN_STR8("/Z7"));
|
DQN_STR8("-EHsc"),
|
||||||
Dqn_FArray_Add(&compile_flags, DQN_STR8("/MT"));
|
DQN_STR8("-nologo"),
|
||||||
Dqn_FArray_Add(&compile_flags, DQN_STR8("/EHsc"));
|
});
|
||||||
Dqn_FArray_Add(&compile_flags, DQN_STR8("/nologo"));
|
|
||||||
} else {
|
} else {
|
||||||
Dqn_FArray_Add(&compile_flags, DQN_STR8("gcc"));
|
Dqn_FArray_AddCArrayAssert(&compile_flags, {
|
||||||
Dqn_FArray_Add(&compile_flags, DQN_STR8("-c"));
|
DQN_STR8("gcc"),
|
||||||
Dqn_FArray_Add(&compile_flags, DQN_STR8("-D _DEFAULT_SOURCE"));
|
DQN_STR8("-g"),
|
||||||
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("-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.build_dir = build_dir;
|
||||||
build_context.compile_flags = Dqn_FArray_Slice(&compile_flags);
|
build_context.compile_flags = Dqn_FArray_Slice(&compile_flags);
|
||||||
build_context.flags_style = flags_style;
|
build_context.flags_style = flags_style;
|
||||||
@ -292,13 +305,11 @@ int main(int argc, char const **argv)
|
|||||||
build_context.compile_files = Dqn_Slice_Init(&build_file, 1);
|
build_context.compile_files = Dqn_Slice_Init(&build_file, 1);
|
||||||
Dqn_FArray_AddAssert(&raylib_pc_output_files, build_file.output_file_path);
|
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_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena);
|
||||||
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd));
|
||||||
} else {
|
if (!dry_run)
|
||||||
Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild);
|
Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: Build rlgfw =======================================================================
|
// NOTE: Build rlgfw =======================================================================
|
||||||
{
|
{
|
||||||
@ -308,14 +319,12 @@ int main(int argc, char const **argv)
|
|||||||
build_context.compile_files = Dqn_Slice_InitCArray(scratch.arena, {build_file});
|
build_context.compile_files = Dqn_Slice_InitCArray(scratch.arena, {build_file});
|
||||||
Dqn_FArray_AddAssert(&raylib_pc_output_files, build_file.output_file_path);
|
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_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena);
|
||||||
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd));
|
||||||
} else {
|
if (!dry_run)
|
||||||
Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild);
|
Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: sokol_audio ================================================================================
|
// NOTE: sokol_audio ================================================================================
|
||||||
Dqn_Str8 sokol_audio_source_code_file = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/External/sokol/sokol_audio.c", DQN_STR_FMT(tely_dir));
|
Dqn_Str8 sokol_audio_source_code_file = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/External/sokol/sokol_audio.c", DQN_STR_FMT(tely_dir));
|
||||||
@ -339,22 +348,16 @@ 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_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;
|
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.compile_flags = Dqn_FArray_Slice(&compile_flags);
|
||||||
build_context.build_dir = build_dir;
|
build_context.build_dir = build_dir;
|
||||||
|
|
||||||
if (dry_run) {
|
|
||||||
Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena);
|
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));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd));
|
||||||
} else {
|
if (!dry_run)
|
||||||
Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild);
|
Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: Feely Pona Sprite Packer ==============================================================
|
// NOTE: Feely Pona Sprite Packer ==============================================================
|
||||||
uint64_t feely_pona_sprite_packer_timings[2] = {};
|
uint64_t feely_pona_sprite_packer_timings[2] = {};
|
||||||
@ -372,13 +375,11 @@ int main(int argc, char const **argv)
|
|||||||
build_context.link_flags = Dqn_FArray_Slice(&common_link_flags);
|
build_context.link_flags = Dqn_FArray_Slice(&common_link_flags);
|
||||||
build_context.build_dir = build_dir;
|
build_context.build_dir = build_dir;
|
||||||
|
|
||||||
if (dry_run) {
|
|
||||||
Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena);
|
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));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd));
|
||||||
} else {
|
if (!dry_run)
|
||||||
Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild);
|
Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: Feely Pona Link Flags =================================================================
|
// NOTE: Feely Pona Link Flags =================================================================
|
||||||
Dqn_FArray32<Dqn_Str8> feely_pona_platform_link_flags = common_link_flags;
|
Dqn_FArray32<Dqn_Str8> feely_pona_platform_link_flags = common_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.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");
|
build_file.output_file_path = Dqn_FsPath_ConvertF(scratch.arena, "terry_cherry");
|
||||||
if (windows_build) {
|
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 {
|
} else {
|
||||||
build_file.prefix_flags = Dqn_Slice_InitCArray(scratch.arena, {DQN_STR8("-xc++")});
|
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.suffix_flags = Dqn_Slice_InitCArray(scratch.arena, {DQN_STR8("-xnone")});
|
||||||
}
|
}
|
||||||
|
|
||||||
Dqn_FArray32<Dqn_Str8> compile_flags = common_compile_flags;
|
Dqn_FArray32<Dqn_Str8> compile_flags = common_compile_flags;
|
||||||
if (windows_build) {
|
Dqn_FArray_AddCArrayAssert(&compile_flags, {
|
||||||
Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/D TELY_WITH_PLATFORM"));
|
DQN_STR8("-D"), DQN_STR8("TELY_WITH_PLATFORM"),
|
||||||
Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/D FEELY_PONA_IMPLEMENTATION"));
|
DQN_STR8("-D"), DQN_STR8("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_CPPBuildContext feely_pona_no_dll_build_context = {};
|
Dqn_CPPBuildContext feely_pona_no_dll_build_context = {};
|
||||||
feely_pona_no_dll_build_context.flags_style = flags_style;
|
feely_pona_no_dll_build_context.flags_style = flags_style;
|
||||||
@ -436,13 +434,11 @@ int main(int argc, char const **argv)
|
|||||||
feely_pona_no_dll_build_context.build_dir = build_dir;
|
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);
|
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_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));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd));
|
||||||
} else {
|
if (!dry_run)
|
||||||
Dqn_CPPBuild_ExecOrAbort(feely_pona_no_dll_build_context, Dqn_CPPBuildMode_AlwaysRebuild);
|
Dqn_CPPBuild_ExecOrAbort(feely_pona_no_dll_build_context, Dqn_CPPBuildMode_AlwaysRebuild);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: Feely Pona DLL ========================================================================
|
// NOTE: Feely Pona DLL ========================================================================
|
||||||
uint64_t feely_pona_dll_timings[2] = {};
|
uint64_t feely_pona_dll_timings[2] = {};
|
||||||
@ -453,13 +449,13 @@ int main(int argc, char const **argv)
|
|||||||
Dqn_CPPBuildCompileFile build_file = {};
|
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.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.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_FArray32<Dqn_Str8> compile_flags = common_compile_flags;
|
||||||
Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/LD"));
|
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("-D FEELY_PONA_IMPLEMENTATION"));
|
||||||
if (!dev_fast_build)
|
if (!dev_fast_build)
|
||||||
Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/analyze"));
|
Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("-analyze"));
|
||||||
|
|
||||||
Dqn_CPPBuildContext build_context = {};
|
Dqn_CPPBuildContext build_context = {};
|
||||||
build_context.flags_style = flags_style;
|
build_context.flags_style = flags_style;
|
||||||
@ -468,13 +464,11 @@ int main(int argc, char const **argv)
|
|||||||
build_context.link_flags = {};
|
build_context.link_flags = {};
|
||||||
build_context.build_dir = build_dir;
|
build_context.build_dir = build_dir;
|
||||||
|
|
||||||
if (dry_run) {
|
|
||||||
Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena);
|
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));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd));
|
||||||
} else {
|
if (!dry_run)
|
||||||
Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_AlwaysRebuild);
|
Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_AlwaysRebuild);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: Feely Pona platform ===================================================================
|
// NOTE: Feely Pona platform ===================================================================
|
||||||
uint64_t feely_pona_platform_timings[2] = {};
|
uint64_t feely_pona_platform_timings[2] = {};
|
||||||
@ -485,11 +479,13 @@ int main(int argc, char const **argv)
|
|||||||
Dqn_CPPBuildCompileFile build_file = {};
|
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.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.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_FArray32<Dqn_Str8> compile_flags = common_compile_flags;
|
||||||
Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/D TELY_WITH_PLATFORM"));
|
Dqn_FArray_AddCArrayAssert(&compile_flags, {
|
||||||
Dqn_FArray_AddAssert(&compile_flags, DQN_STR8("/D TELY_WITH_PLATFORM_DLL"));
|
DQN_STR8("-D"), DQN_STR8("TELY_WITH_PLATFORM"),
|
||||||
|
DQN_STR8("-D"), DQN_STR8("TELY_WITH_PLATFORM_DLL"),
|
||||||
|
});
|
||||||
|
|
||||||
Dqn_CPPBuildContext build_context = {};
|
Dqn_CPPBuildContext build_context = {};
|
||||||
build_context.flags_style = flags_style;
|
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.build_dir = build_dir;
|
||||||
build_context.include_dirs = Dqn_Slice_InitCArray(scratch.arena, {raylib_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_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena);
|
||||||
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd));
|
||||||
} else {
|
if (!dry_run) {
|
||||||
Dqn_Str8 exe_path = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/terry_cherry_dev.exe", DQN_STR_FMT(build_dir));
|
Dqn_Str8 exe_path = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/terry_cherry_dev.exe", DQN_STR_FMT(build_dir));
|
||||||
bool exe_is_locked = false;
|
bool exe_is_locked = false;
|
||||||
if (Dqn_Fs_Exists(exe_path)) {
|
if (Dqn_Fs_Exists(exe_path)) {
|
||||||
@ -571,13 +566,11 @@ int main(int argc, char const **argv)
|
|||||||
raylib_emscripten_build_context.build_dir = build_dir;
|
raylib_emscripten_build_context.build_dir = build_dir;
|
||||||
Dqn_FArray_AddAssert(&emscripten_obj_files, build_file.output_file_path);
|
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_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));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd));
|
||||||
} else {
|
if (!dry_run)
|
||||||
Dqn_CPPBuild_ExecOrAbort(raylib_emscripten_build_context, Dqn_CPPBuildMode_CacheBuild);
|
Dqn_CPPBuild_ExecOrAbort(raylib_emscripten_build_context, Dqn_CPPBuildMode_CacheBuild);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Dqn_Str8 base_file = sokol_audio_source_code_file;
|
Dqn_Str8 base_file = sokol_audio_source_code_file;
|
||||||
@ -602,13 +595,11 @@ int main(int argc, char const **argv)
|
|||||||
raylib_emscripten_build_context.build_dir = build_dir;
|
raylib_emscripten_build_context.build_dir = build_dir;
|
||||||
Dqn_FArray_AddAssert(&emscripten_obj_files, build_file.output_file_path);
|
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_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));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd));
|
||||||
} else {
|
if (!dry_run)
|
||||||
Dqn_CPPBuild_ExecOrAbort(raylib_emscripten_build_context, Dqn_CPPBuildMode_CacheBuild);
|
Dqn_CPPBuild_ExecOrAbort(raylib_emscripten_build_context, Dqn_CPPBuildMode_CacheBuild);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: Build the wasm raylib+sokol_audio library =====================================
|
// NOTE: Build the wasm raylib+sokol_audio library =====================================
|
||||||
{
|
{
|
||||||
@ -622,14 +613,13 @@ int main(int argc, char const **argv)
|
|||||||
|
|
||||||
Dqn_FArray_AddArrayAssert(&cmd_args, emscripten_obj_files.data, emscripten_obj_files.size);
|
Dqn_FArray_AddArrayAssert(&cmd_args, emscripten_obj_files.data, emscripten_obj_files.size);
|
||||||
Dqn_Slice<Dqn_Str8> cmd_slice = Dqn_FArray_Slice(&cmd_args);
|
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_Str8 cmd = Dqn_Slice_Str8Render(scratch.arena, cmd_slice, DQN_STR8(" ") /*separator*/);
|
||||||
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "%.*s\n", DQN_STR_FMT(cmd));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd));
|
||||||
} else {
|
if (!dry_run)
|
||||||
Dqn_OS_ExecOrAbort(cmd_slice, build_dir);
|
Dqn_OS_ExecOrAbort(cmd_slice, build_dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: feely pona emscripten =============================================================
|
// NOTE: feely pona emscripten =============================================================
|
||||||
{
|
{
|
||||||
@ -707,12 +697,10 @@ int main(int argc, char const **argv)
|
|||||||
build_context.compile_flags = Dqn_FArray_Slice(&compile_flags);
|
build_context.compile_flags = Dqn_FArray_Slice(&compile_flags);
|
||||||
build_context.build_dir = build_dir;
|
build_context.build_dir = build_dir;
|
||||||
|
|
||||||
if (dry_run) {
|
|
||||||
Dqn_Str8 cmd = Dqn_CPPBuild_ToCommandLineStr8(build_context, Dqn_CPPBuildMode_AlwaysRebuild, scratch.arena);
|
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));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd));
|
||||||
} else {
|
if (!dry_run)
|
||||||
Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild);
|
Dqn_CPPBuild_ExecOrAbort(build_context, Dqn_CPPBuildMode_CacheBuild);
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: Move the files to a directory
|
// 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));
|
Dqn_Str8 folder_path = Dqn_FsPath_ConvertF(scratch.arena, "%.*s/%.*s", DQN_STR_FMT(build_dir), DQN_STR_FMT(output_name));
|
||||||
@ -743,15 +731,13 @@ int main(int argc, char const **argv)
|
|||||||
Dqn_FArray_AddAssert(&cmd_args, dest_path);
|
Dqn_FArray_AddAssert(&cmd_args, dest_path);
|
||||||
|
|
||||||
Dqn_Slice<Dqn_Str8> cmd_slice = Dqn_FArray_Slice(&cmd_args);
|
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_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));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "[BUILD] Executing '%.*s'", DQN_STR_FMT(cmd_rendered));
|
||||||
} else {
|
if (!dry_run)
|
||||||
Dqn_OS_ExecOrAbort(cmd_slice, build_dir);
|
Dqn_OS_ExecOrAbort(cmd_slice, build_dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
build_timings[1] = Dqn_OS_PerfCounterNow();
|
build_timings[1] = Dqn_OS_PerfCounterNow();
|
||||||
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "\n-- Dqn_CPPBuild Timings (%.2fms)", Dqn_OS_PerfCounterMs(build_timings[0], build_timings[1]));
|
Dqn_Print_StdLnF(Dqn_PrintStd_Out, "\n-- Dqn_CPPBuild Timings (%.2fms)", Dqn_OS_PerfCounterMs(build_timings[0], build_timings[1]));
|
||||||
|
Loading…
Reference in New Issue
Block a user