Standard setup for writing C inspired by Casey Muratori, Ryan Fleury, Mr. 4th Programmer, and others in the handmade community.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

28 lignes
1.4 KiB

  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%