Standard setup for writing C inspired by Casey Muratori, Ryan Fleury, Mr. 4th Programmer, and others in the handmade community.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

28 Zeilen
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 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 -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%