This commit is contained in:
2024-11-24 20:21:08 +00:00
parent 2a1b24af1f
commit 7b9b6f3200
8 changed files with 91 additions and 96 deletions

26
misc/cmds/build.bat Normal file
View File

@@ -0,0 +1,26 @@
@echo off
if NOT EXIST .\build mkdir .\build
set commonLinkerFlags= -opt:ref user32.lib Gdi32.lib winmm.lib
set commonCompilerFlags=^
-MT %= Make sure the C runtime library is statically linked =%^
-Gm- %= Turns off incremently building =%^
-nologo %= No one cares you made the compiler Microsoft =%^
-Oi %= Always use intrinsics =%^
-EHa- %= Disable exception handling =%^
-GR- %= Never use runtime type info from C++ =%^
-WX -W4 -wd4201 -wd4100 -wd4189 -wd4505 %= Compiler warnings, -WX warnings as errors, -W4 warning level 4, -wdXXXX disable warning XXXX =%^
-DHANDMADE_INTERNAL=1 -DHANDMADE_SLOW=1 -DHANDMADE_WIN32=1 %= Custom #defines =%^
-FC %= Full path of source code file in diagnostics =%^
-Zi %= Generate debugger info =%
pushd .\build
cl %commonCompilerFlags% ..\src\handmade.cpp -Fmhandmade.map -LD /link -incremental:no -EXPORT:gameGetSoundSamples -EXPORT:gameUpdateAndRender
cl %commonCompilerFlags% -Fe:handmade_win32.exe ..\src\win32_handmade.cpp -Fmwin32_handmade.map /link -incremental:no %commonLinkerFlags%
popd
exit /b
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%