-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
39 lines (32 loc) · 1003 Bytes
/
build.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@echo off
rem run within source folder src\
rem https://docs.microsoft.com/en-us/cpp/build/reference/output-file-f-options?view=msvc-160
set Mode=release
set OutputFolder=release
set Optimization=/O2
set Subsystem=/SUBSYSTEM:console
rem set Subsystem=/SUBSYSTEM:windows
if !%1!==!debug! (
set Mode=debug
set OutputFolder=debug
set Optimization=/Od
)
set WinLibs=User32.lib Gdi32.lib shell32.lib vcruntime.lib
set ExternalLibs=
set IncludePaths=/I..\include
set CompilationFlags=/Zi %Optimization% /EHa- /Zo
set WarningLevel=/W4
set IWPadding=/wd4820
set IWNamelessUnion=/wd4201
set IWInitializedNotReferenced=/wd4189
set IgnoreWarnings=%IWPadding% %IWInitializedNotReferenced% %IWNamelessUnion%
if not exist %OutputFolder% (
mkdir %OutputFolder%
)
pushd %OutputFolder%
set dlls=..\main.cpp ..\world.cpp ..\memory.cpp
cl /nologo %WarningLevel% %IgnoreWarnings% %CompilationFlags% %IncludePaths% ^
%dlls% ^
/link /incremental:no /opt:ref ^
%WinLibs% %ExternalLibs%
popd