Standard setup for writing C inspired by Casey Muratori, Ryan Fleury, Mr. 4th Programmer, and others in the handmade community.
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.

build.bat 1.4 KiB

2 viikkoa sitten
2 viikkoa sitten
2 viikkoa sitten
123456789101112131415161718192021222324252627
  1. @echo off
  2. if NOT EXIST .\target mkdir .\target
  3. set commonLinkerFlags=-opt:ref
  4. set commonCompilerFlags=^
  5. -MT %= Make sure the C runtime library is statically linked =%^
  6. -Gm- %= Turns off incremental 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 -wd4505 %= Compiler warnings, -WX warnings as errors, -W4 warning level 4, -wdXXXX disable warning XXXX =%^
  12. -DAPP_DEBUG=0 -DENABLE_ASSERT=1 -DOS_WINDOWS=1 %= Custom #defines =%^
  13. -D_CRT_SECURE_NO_WARNINGS=1^
  14. -FC %= Full path of source code file in diagnostics =%^
  15. -Zi %= Generate debugger info =%
  16. pushd .\target
  17. cl %commonCompilerFlags% -Fe:.\app.exe ..\app.cpp /link -incremental:no %commonLinkerFlags%
  18. popd
  19. exit /b
  20. :error
  21. echo Failed with error #%errorlevel%.
  22. exit /b %errorlevel%