-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpremake5inc.lua
188 lines (165 loc) · 6.19 KB
/
premake5inc.lua
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
-- This is not a complete premake5 lua script, it's meant to be included from another script that defines the workspace.
-- Like this, for example:
-- local rootDir = os.getcwd()
-- os.chdir( "../Engine/" )
-- include( "premake5inc.lua" )
-- os.chdir( rootDir )
-- To exclude Lua, set 'PremakeConfig_UseLua' to false and add 'defines "MYFW_USE_LUA=0"' to your project.
if PremakeConfig_UseLua == nil then
PremakeConfig_UseLua = true
end
if PremakeConfig_UseMono == nil then
PremakeConfig_UseMono = true
end
-- To exclude Box2D, set 'PremakeConfig_UseBox2D' to false and add 'defines "MYFW_USE_BOX2D=0"' to your project.
if PremakeConfig_UseBox2D == nil then
PremakeConfig_UseBox2D = true
end
-- To exclude Bullet, set 'PremakeConfig_UseBullet' to false and add 'defines "MYFW_USE_BULLET=0"' to your project.
if PremakeConfig_UseBullet == nil then
PremakeConfig_UseBullet = true
end
if PremakeConfig_UseMemoryTracker == nil then
PremakeConfig_UseMemoryTracker = true
end
if MyEnginePremakeConfig_FrameworkFolder == nil then
MyEnginePremakeConfig_FrameworkFolder = "$(SolutionDir)../Framework"
end
if monoInstallationPath == nil then
monoInstallationPath = "C:/Program Files (x86)/Mono" -- TODO: Don't hardcode the path to mono installation.
end
project "MyEngine"
configurations { "Debug", "Release", "EditorDebug", "EditorRelease" }
uuid "CBF52F7E-23CE-4846-B48C-0146D0879805"
kind "StaticLib"
language "C++"
targetdir "$(SolutionDir)Output/%{cfg.platform}-%{prj.name}-%{cfg.buildcfg}"
objdir "$(SolutionDir)Output/Intermediate/%{cfg.platform}-%{prj.name}-%{cfg.buildcfg}"
pchheader "MyEnginePCH.h"
pchsource "MyEngine/SourceCommon/MyEnginePCH.cpp"
includedirs {
"MyEngine/SourceCommon",
"Libraries/bullet3/src",
MyEnginePremakeConfig_FrameworkFolder .. "/Libraries/b2Settings",
MyEnginePremakeConfig_FrameworkFolder .. "/Libraries/Box2D/include",
MyEnginePremakeConfig_FrameworkFolder .. "/Libraries/Box2D/src",
monoInstallationPath .. "/include/mono-2.0",
"Libraries/imgui",
}
files {
"MyEngine/SourceCommon/**.cpp",
"MyEngine/SourceCommon/**.h",
"Libraries/imgui/im*.cpp",
"Libraries/imgui/im*.h",
"Libraries/imgui/README.md",
"Libraries/Lua/src/*.c",
"Libraries/Lua/src/*.h",
"Libraries/LuaBridge/**.h",
"DataEngineSource/**.cs",
"VSCode-MyEngineLua/snippets/snippets.json",
"VSCode-MyEngineLua/source/**",
"README.md",
"premake5inc.lua",
"Libraries/premake5inc-bullet.lua",
}
vpaths {
-- Place these files in the root of the project.
[""] = {
"README.md",
"premake5inc.lua",
},
-- Place the SourceCommon and SourceEditor folders in the root of the project.
["*"] = {
"MyEngine",
},
-- Place the Libraries folder in the root of the project.
["Libraries*"] = {
"Libraries",
},
-- Place the DataEngineSource folder in the root of the project.
["DataEngineSource*"] = {
"DataEngineSource",
},
-- Place the VSCode-MyEngineLua folder in the root of the project.
["VSCode-MyEngineLua*"] = {
"VSCode-MyEngineLua",
},
}
filter { "files:Libraries/Lua/src/lua.c"
.. " or Libraries/Lua/src/luac.c"
.. " or MyEngine/SourceEditor/EditorMainFrame_Wx.*"
.. " or MyEngine/SourceEditor/Dialogs/DialogGridSettings.*"
}
flags "ExcludeFromBuild"
filter { "files:Libraries/**" }
flags "NoPCH"
filter "system:windows"
platforms { "x86", "x64" }
defines "MYFW_WINDOWS"
systemversion "latest"
characterset "MBCS"
filter "configurations:Debug or EditorDebug"
defines "_DEBUG"
symbols "on"
filter "configurations:Release or EditorRelease"
defines "NDEBUG"
optimize "Full"
filter "configurations:EditorDebug or EditorRelease"
defines { "MYFW_EDITOR", "MYFW_USING_IMGUI" }
if MyEnginePremakeConfig_ForceIncludeEditorFiles == true then
filter {}
else
filter "configurations:EditorDebug or EditorRelease"
end
files {
"MyEngine/SourceEditor/**.cpp",
"MyEngine/SourceEditor/**.h",
"Libraries/imgui/misc/cpp/im*.cpp",
"Libraries/imgui/misc/cpp/im*.h",
}
if PremakeConfig_UseLua == true then
filter {}
defines "MYFW_USE_LUA"
else
filter {}
defines "MYFW_USE_LUA=0"
filter { "files:Libraries/Lua/**" }
flags "ExcludeFromBuild"
end
if PremakeConfig_UseMono == true then
filter {}
defines "MYFW_USE_MONO"
else
filter { "files:MyEngine/SourceCommon/Mono/**" }
flags "ExcludeFromBuild"
end
if PremakeConfig_UseBox2D == true then
filter {}
defines "MYFW_USE_BOX2D"
else
filter {}
defines "MYFW_USE_BOX2D=0"
filter { "files:MyEngine/SourceCommon/Physics/Box2D**" }
flags "ExcludeFromBuild"
filter { "files:MyEngine/SourceEditor/Exporters/ExportBox2DScene**" }
flags "ExcludeFromBuild"
filter { "files:MyEngine/SourceCommon/Physics/*Box2D**" }
flags "ExcludeFromBuild"
filter { "files:MyEngine/SourceCommon/ComponentSystem/FrameworkComponents/Physics2D/**" }
flags "ExcludeFromBuild"
end
if PremakeConfig_UseBullet == true then
filter {}
defines "MYFW_USE_BULLET"
else
filter {}
defines "MYFW_USE_BULLET=0"
filter { "files:MyEngine/SourceCommon/Physics/Bullet**" }
flags "ExcludeFromBuild"
filter { "files:MyEngine/SourceCommon/ComponentSystem/FrameworkComponents/Physics3D/**" }
flags "ExcludeFromBuild"
end
if PremakeConfig_UseMemoryTracker == true then
filter "configurations:Debug or EditorDebug or EditorRelease"
defines "MYFW_USE_MEMORY_TRACKER"
end