30 lines
1.5 KiB
Batchfile
30 lines
1.5 KiB
Batchfile
@echo off
|
|
|
|
if NOT EXIST .\target mkdir .\target
|
|
|
|
set LIBRARIES_ROOT="C:\source\libs"
|
|
set INCLUDE_ROOT="C:\source\libs\include"
|
|
|
|
set LINK_LIBRARIES=".\glfw\glfw3.lib" "user32.lib" "gdi32.lib" "opengl32.lib" "shell32.lib" "kernel32.lib"
|
|
set COMMON_LINKER_FLAGS=-opt:ref /LIBPATH:%LIBRARIES_ROOT% /NODEFAULTLIB:libcmt.lib
|
|
set COMMON_COMPILER_FLAGS=^
|
|
-MT %= Make sure the C runtime library is statically linked =%^
|
|
-Gm- %= Turns off incremental building =%^
|
|
-nologo %= No one cares you made the compiler Microsoft =%^
|
|
-Oi %= Always use intrinsics =%^
|
|
-WX -W4 -wd4201 -wd4100 -wd4189 -wd4505 %= Compiler warnings, -WX warnings as errors, -W4 warning level 4, -wdXXXX disable warning XXXX =%^
|
|
-DAPP_DEBUG=0 -DENABLE_ASSERT=1 -DOS_WINDOWS=1 %= Custom #defines =%^
|
|
-D_CRT_SECURE_NO_WARNINGS=1^
|
|
-FC %= Full path of source code file in diagnostics =%^
|
|
-Zi %= Generate debugger info =%
|
|
|
|
pushd .\target
|
|
cl %COMMON_COMPILER_FLAGS% /EHsc /I %INCLUDE_ROOT% -Fe:.\somaesque.exe ..\src\main.cpp /link -incremental:no %COMMON_LINKER_FLAGS% %LINK_LIBRARIES%
|
|
popd
|
|
|
|
exit /b
|
|
|
|
:error
|
|
echo Failed with error #%errorlevel%.
|
|
exit /b %errorlevel%
|