You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

27 line
1.6 KiB

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