2017-03-28 07:40:38 +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-04 06:27:49 +00:00
|
|
|
set ProjectName=dchip8
|
|
|
|
set CompileEntryPoint=..\src\unity_build.cpp
|
2017-03-28 07:40:38 +00:00
|
|
|
|
|
|
|
ctime -begin %ProjectName%.ctm
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
REM EHa- disable exception handling (we don't use)
|
|
|
|
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 wd4100 ignore: unused argument parameters
|
|
|
|
REM wd4201 ignore: nonstandard extension used: nameless struct/union
|
|
|
|
REM wd4189 ignore: local variable is initialised but not referenced
|
2017-04-05 13:08:40 +00:00
|
|
|
REM wd4505 ignore: unreference local functions that will be removed
|
2017-03-28 07:40:38 +00:00
|
|
|
|
2017-04-05 13:08:40 +00:00
|
|
|
set CompileFlags=-EHa- -GR- -Oi -MT -Z7 -W4 -WX -wd4100 -wd4201 -wd4189 -wd4505
|
2017-03-28 07:40:38 +00:00
|
|
|
|
|
|
|
REM Include directories
|
|
|
|
set IncludeFlags=
|
|
|
|
|
|
|
|
REM Link libraries
|
2017-04-07 11:19:03 +00:00
|
|
|
set LinkLibraries=user32.lib gdi32.lib msimg32.lib Comdlg32.lib
|
2017-03-28 07:40:38 +00:00
|
|
|
|
|
|
|
REM incrmenetal:no, turn incremental builds off
|
|
|
|
REM opt:ref, try to remove functions from libs that are referenced at all
|
|
|
|
set LinkFlags=-incremental:no -opt:ref
|
|
|
|
|
2017-04-04 06:27:49 +00:00
|
|
|
cl %CompileFlags% %CompileEntryPoint% %IncludeFlags% /link -subsystem:WINDOWS,5.1 %LinkLibraries% %LinkFlags% /nologo /OUT:"%ProjectName%.exe"
|
2017-03-28 07:40:38 +00:00
|
|
|
|
|
|
|
popd
|
|
|
|
ctime -end %ProjectName%.ctm
|
|
|
|
|