Skip to content

Commit

Permalink
Support .res files in buildAll.bat
Browse files Browse the repository at this point in the history
And add cleanAll.bat
  • Loading branch information
npiegdon committed Jan 29, 2023
1 parent 8f9047a commit 7bdac3d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 14 additions & 3 deletions buildAll.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%

)
)
4 changes: 4 additions & 0 deletions cleanAll.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
del *.obj
del *.res
del *.exe

0 comments on commit 7bdac3d

Please sign in to comment.