From 2b2857d12afa592a5c6727eb8cb77164e28c0574 Mon Sep 17 00:00:00 2001 From: tijani Date: Sun, 4 Aug 2024 16:33:25 +0000 Subject: [PATCH] Needs a complete rewrite to handle its goals but works for now. git-svn-id: https://svn.tlawal.org/svn/ragar@8 618e81bd-0769-42e7-8608-769e73fecc77 --- build.bat | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/build.bat b/build.bat index 18daf26..0d43a44 100644 --- a/build.bat +++ b/build.bat @@ -17,12 +17,15 @@ cd /D "%~dp0" :: `build debug` :: `build debug msvc` :: `build release clang` +:: `build debug tracy` :: :: Unpack Arguments -for %%a in (%*) do in set "%%a=1" -if not "%msvc%"=="1" if not "%clang%"=="1" set msvc=1 +for %%a in (%*) do set "%%a=1" + +if not "%msvc%"=="1" set msvc=1 if not "%release%"=="1" set debug=1 + if "%debug%"=="1" set release=0 && echo [debug mode] if "%release%"=="1" set debug=0 && echo [release mode] @@ -33,6 +36,10 @@ if "%clang%"=="1" set msvc=0 && echo [clang compile] if "%~1"=="" echo [default mode] && set ragar=1 if "%~1"=="release" if "%~2"=="" echo [default release mode] && set ragar=1 +:: Unpack Command Line Build arguments +set auto_compile_flags= +if "%tracy%"=="1" set auto_compile_flags=%auto_compile_flags% /DTRACY_ENABLE && echo [tracy profiling enabled] + :: Third Party libraries set third_party_includes="%~dp0\src\\third_party\\SDL2\\include" set third_party_lib="%~dp0\src\\third_party\\SDL2\\lib\\x64" @@ -44,12 +51,7 @@ set cl_release= call cl /O2 /DBUILD_DEBUG=0 %cl_common% set cl_link= /link /INCREMENTAL:NO resource.res /LIBPATH:%third_party_lib% SDL2.lib SDL2main.lib shell32.lib set cl_out= /out: -:: Clang -set clang_common= -I..\src\ -I..\local\ -gcodeview -fdiagnostics-absolute-paths -Wall -Wno-unknown-warning-option -Wno-missing-braces -Wno-unused-function -Wno-writable-strings -Wno-unused-value -Wno-unused-variable -Wno-unused-local-typedef -Wno-deprecated-register -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-single-bit-bitfield-constant-conversion -Wno-compare-distinct-pointer-types -Wno-initializer-overrides -Wno-incompatible-pointer-types-discards-qualifiers -Xclang -flto-visibility-public-std -D_USE_MATH_DEFINES -Dstrdup=_strdup -Dgnu_printf=printf -set clang_debug= call clang -g -O0 -DBUILD_DEBUG=1 %clang_common% %auto_compile_flags% -set clang_release= call clang -g -O2 -DBUILD_DEBUG=0 %clang_common% %auto_compile_flags% -set clang_link= -fuse-ld=lld -Xlinker /MANIFEST:EMBED -Xlinker logo.res -set clang_out= -o +:: Clang NOTE(tijani): Coming soon :: Per-Build Setting