From c3511ba954e1b1388b20cca881ea664d543830fc Mon Sep 17 00:00:00 2001 From: Phillip Trudeau-Tavara Date: Wed, 23 Aug 2023 06:06:40 -0400 Subject: [PATCH] Accept command line arguments in build_web_common --- build_desktop_debug.bat | 14 ++++++-------- build_web_common.bat | 10 +++++++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/build_desktop_debug.bat b/build_desktop_debug.bat index 87d4c60..6cd2744 100644 --- a/build_desktop_debug.bat +++ b/build_desktop_debug.bat @@ -3,16 +3,14 @@ @REM https://learn.microsoft.com/en-us/cpp/build/reference/compiler-options-listed-by-category?view=msvc-170 setlocal enableDelayedExpansion - -set "should_do_blender_export=0" -set "should_do_codegen=0" +set "do_blender_export=0" +set "do_codegen=0" for %%A in (%*) do ( - if "%%~A"=="blender_export" ( set "should_do_blender_export=1" ) - if "%%~A"=="codegen" ( set "should_do_codegen=1" ) + if "%%~A"=="blender_export" ( set "do_blender_export=1" ) + if "%%~A"=="codegen" ( set "do_codegen=1" ) ) - -if "%should_do_blender_export%"=="1" ( call blender_export.bat || goto :error ) -if "%should_do_codegen%"=="1" ( call run_codegen.bat || goto :error ) +if "%do_blender_export%"=="1" ( call blender_export.bat || goto :error ) +if "%do_codegen%"=="1" ( call run_codegen.bat || goto :error ) @REM start /B zig cc -DDEVTOOLS -Igen -Ithirdparty -lDbghelp -lGdi32 -lD3D11 -lOle32 -lwinhttp -gfull -gcodeview -o main_zig.exe main.c cl /nologo /diagnostics:caret /DDEVTOOLS /Igen /Ithirdparty /Wall /FC /Zi /WX main.c /link /noimplib /noexp || goto :error diff --git a/build_web_common.bat b/build_web_common.bat index a1d6560..94b70dc 100644 --- a/build_web_common.bat +++ b/build_web_common.bat @@ -1,4 +1,12 @@ -call run_codegen.bat || goto :error +setlocal enableDelayedExpansion +set "do_blender_export=0" +set "do_codegen=0" +for %%A in (%*) do ( + if "%%~A"=="blender_export" ( set "do_blender_export=1" ) + if "%%~A"=="codegen" ( set "do_codegen=1" ) +) +if "%do_blender_export%"=="1" ( call blender_export.bat || goto :error ) +if "%do_codegen%"=="1" ( call run_codegen.bat || goto :error ) copy marketing_page\favicon.ico %OUTPUT_FOLDER%\favicon.ico @REM copy main.c %OUTPUT_FOLDER%\main.c || goto :error