Dqn/build.bat

51 lines
1.6 KiB
Batchfile
Raw Normal View History

2017-04-09 05:08:31 +00:00
@REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or
@REM vcvarsall.bat to setup command-line compiler.
@echo OFF
2017-04-10 08:40:15 +00:00
set ProjectName=dqn_unit_test
set CompileEntryPoint=..\dqn_unit_test.cpp
2017-04-09 05:08:31 +00:00
REM Build tags file
ctags -R
REM Check if build tool is on path
REM >nul, 2>nul will remove the output text from the where command
where cl.exe >nul 2>nul
if %errorlevel%==1 call msvc86.bat
REM Drop compilation files into build folder
IF NOT EXIST bin mkdir bin
pushd bin
2017-06-28 12:47:27 +00:00
REM EHa- disable exception handling (but we use for algorithms so /EHsc)
2017-04-09 05:08:31 +00:00
REM GR- disable c runtime type information (we don't use)
REM MD use dynamic runtime library
REM MT use static runtime library, so build and link it into exe
REM Oi enable intrinsics optimisation, let us use CPU intrinsics if there is one
REM instead of generating a call to external library (i.e. CRT).
REM Zi enables debug data, Z7 combines the debug files into one.
REM W4 warning level 4
REM WX treat warnings as errors
REM wd4201 ignore: nonstandard extension used: nameless struct/union
set CompileFlags=-EHsc -GR- -Oi -MT -Z7 -W4 -WX -wd4201 -FC -Od -wd4127
2017-04-09 05:08:31 +00:00
REM Include directories
set IncludeFlags=
REM Link libraries
set LinkLibraries=user32.lib gdi32.lib msimg32.lib
REM incrmenetal:no, turn incremental builds off
REM opt:ref, try to remove functions from libs that are referenced at all
2017-06-28 12:47:27 +00:00
set LinkFlags=-incremental:no -opt:ref -machine:x64
2017-04-09 05:08:31 +00:00
cl %CompileFlags% %CompileEntryPoint% %IncludeFlags% /link %LinkLibraries% %LinkFlags% /nologo /OUT:"%ProjectName%.exe"
2017-05-01 06:40:52 +00:00
REM cl /P /c %CompileFlags% %CompileEntryPoint%
2017-04-09 05:08:31 +00:00
popd