-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.bat
134 lines (113 loc) · 3.48 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
@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
setlocal ENABLEDELAYEDEXPANSION
rem Use wrapper for comparison ""
rem Inside of IF statements use !! to force setting variables before using them
cls
set Mode=release
set OutputFolder=release
if "%1"=="debug" (
set Mode=debug
set OutputFolder=debug
rem VS locks .pdb files. Create dummy _temp and in win32_platform
rem we have logic to pickup temp file and copy it
set Dllreload=_temp
set BUILD_COMPILATION_FLAGS=/DDEBUG=1
)
set BuildDllID=All
if "%2" NEQ "" (
set BuildDllID=%2
)
echo Build request: %BuildDllID%
if not exist %OutputFolder% (
mkdir %OutputFolder%
)
pushd %OutputFolder%
set WinLibs=kernel32.lib User32.lib Gdi32.lib shell32.lib vcruntime.lib winmm.lib
set CompilationFlags=%BUILD_COMPILATION_FLAGS%
if "%Mode%"=="release" (
set CompilationFlags=%CompilationFlags% /O2
)
set ExternalLibs=
set IncludePaths=/I..\..\include
set GenerateCompleteDebuggingInfo=/Zi
set WarningLevel=/W4
set IWPadding=/wd4820
set IWInitializedNotReferenced=/wd4189
set IWUnusedParam=/wd4100
set IWNamelessStructUnion=/wd4201
set IgnoreWarnings=%IWPadding% %IWInitializedNotReferenced% %IWUnusedParam% %IWNamelessStructUnion%
set BuildThis=Y
if "%BuildDllID%" NEQ "All" (
if "%BuildDllID%" NEQ "1" (
set BuildThis=N
)
)
if "%BuildThis%"=="Y" (
set graphicsDllName=graphics_api
set graphicsOutput=!graphicsDllName!!Dllreload!
set GraphicsLib=graphics_api
set dllname=!GraphicsLib!
echo Building graphics DLL !dllname!
erase !dllname!*
cl /nologo ^
/LD !WarningLevel! !IgnoreWarnings! !GenerateCompleteDebuggingInfo! !CompilationFlags! !IncludePaths! ^
..\!dllname!.cpp ..\vulkan_helpers.cpp ..\hierarchy_tree.cpp ..\game_memory.cpp ^
/Fe:!graphicsOutput!.dll ^
/link /DLL ^
/incremental:no /opt:ref /PDB:!graphicsOutput!_!random!.pdb ^
!ExternalLibs!
)
set BuildThis=Y
if "%BuildDllID%" NEQ "All" (
if "%BuildDllID%" NEQ "2" (
set BuildThis=N
)
)
if "%BuildThis%"=="Y" (
set dllname=win32_platform
erase !dllname!*
cl /nologo ^
!WarningLevel! !IgnoreWarnings! !GenerateCompleteDebuggingInfo! !CompilationFlags! !IncludePaths! ..\!dllname!.cpp ^
/Fm!dllname!.map ^
/link ^
/PDB:!dllname!.pdb ^
/SUBSYSTEM:CONSOLE ^
!WinLibs!
)
set BuildThis=Y
if "%BuildDllID%" NEQ "All" (
if "%BuildDllID%" NEQ "3" (
set BuildThis=N
)
)
if "%BuildThis%"=="Y" (
set dllname=game
set dllnameOutput=!dllname!!Dllreload!
rem ..\data_load.cpp ..\game_memory.cpp ..\game_entity.cpp ..\Quaternion.cpp ..\game_render.cpp ..\game_mesh.cpp ..\game_world.cpp ..\game_simulation.cpp ^
echo Building Game DLL !dllname!
erase !dllname!*
cl /nologo ^
/LD /MTd ^
/Fm!dllname!.map !WarningLevel! !IgnoreWarnings! !GenerateCompleteDebuggingInfo! !CompilationFlags! !IncludePaths! ..\!dllname!.cpp ^
..\game_memory.cpp ..\game_entity.cpp ..\Quaternion.cpp ..\game_render.cpp ..\game_world.cpp ..\game_assets.cpp ..\collision.cpp ^
/Fe:!dllnameOutput!.dll ^
/link ^
/DLL ^
/incremental:no /opt:ref /PDB:!dllnameOutput!_!random!.pdb
)
popd
set BuildThis=Y
if "%BuildDllID%" NEQ "All" (
if "%BuildDllID%" NEQ "4" (
set BuildThis=N
)
)
if "%BuildThis%"=="Y" (
if !%Mode%!==!release! (
call python ..\shaders.py
) else (
call python ..\shaders.py d
)
)