diff --git a/buildAll.bat b/buildAll.bat index 11638cf..cc7ce34 100644 --- a/buildAll.bat +++ b/buildAll.bat @@ -6,9 +6,20 @@ where /q cl || ( exit /b 1 ) -set CFLAGS=/nologo /W3 /Z7 /EHsc /GS- /Gs999999 /std:c++17 /openmp -set LDFLAGS=/incremental:no /opt:icf /opt:ref +set CFLAGS=/nologo /W3 /EHsc /GS- /Gs999999 /std:c++17 /openmp +set LDFLAGS=/incremental:no /opt:icf /opt:ref /subsystem:windows for %%f in (example*.cpp) do ( - call cl -O2 %CFLAGS% %%~nf.cpp /link %LDFLAGS% /subsystem:windows + if exist %%~nf.rc ( + + :: If there's an accompanying resource file, compile it, too. + call rc.exe /nologo %%~nf.rc + call cl.exe -O2 %CFLAGS% %%~nf.cpp %%~nf.res /link %LDFLAGS% + + ) else ( + + :: No resource file, just compile the code. + call cl.exe -O2 %CFLAGS% %%~nf.cpp /link %LDFLAGS% + + ) ) diff --git a/cleanAll.bat b/cleanAll.bat new file mode 100644 index 0000000..ec4edac --- /dev/null +++ b/cleanAll.bat @@ -0,0 +1,4 @@ +@echo off +del *.obj +del *.res +del *.exe