forked from bombomby/optick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genie.lua
257 lines (209 loc) · 4.87 KB
/
genie.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
newoption {
trigger = "UWP",
description = "Generates Universal Windows Platform application type",
}
if not _ACTION then
_ACTION = "vs2012"
end
outFolderRoot = "Bin/" .. _ACTION .. "/";
isVisualStudio = false
isUWP = false
if _ACTION == "vs2010" or _ACTION == "vs2012" or _ACTION == "vs2015" then
if _OPTIONS['platform'] ~= "orbis" then
isVisualStudio = true
end
end
if _OPTIONS["UWP"] then
isUWP = true
end
if isUWP then
premake.vstudio.toolset = "v140"
premake.vstudio.storeapp = "10.0"
end
outputFolder = "Build/" .. _ACTION
if isUWP then
outputFolder = outputFolder .. "_UWP"
end
solution "Brofiler"
language "C++"
startproject "BrofilerTest"
location ( outputFolder )
flags {
"NoManifest",
"ExtraWarnings",
"Unicode",
}
optimization_flags = { "OptimizeSpeed" }
if isVisualStudio then
debugdir (outFolderRoot)
end
if isUWP then
defines { "BRO_UWP=1" }
end
defines { "BRO_USE_BROFILER=1" }
defines { "BRO_FIBERS=1" }
local config_list = {
"Release",
"Debug",
}
local platform_list = {
"x32",
"x64",
"Native",
}
configurations(config_list)
platforms(platform_list)
-- CONFIGURATIONS
if _ACTION == "vs2010" then
defines { "_DISABLE_DEPRECATE_STATIC_CPPLIB", "_STATIC_CPPLIB"}
end
configuration "Release"
targetdir(outFolderRoot .. "/Native/Release")
defines { "NDEBUG", "MT_INSTRUMENTED_BUILD" }
flags { "Symbols", optimization_flags }
configuration "Debug"
targetdir(outFolderRoot .. "/Native/Debug")
defines { "_DEBUG", "_CRTDBG_MAP_ALLOC", "MT_INSTRUMENTED_BUILD", "_ITERATOR_DEBUG_LEVEL=1"}
flags { "Symbols" }
-- give each configuration/platform a unique output directory
for _, config in ipairs(config_list) do
for _, plat in ipairs(platform_list) do
configuration { config, plat }
objdir ( outputFolder .. "/Temp/" )
tgtDir = outFolderRoot .. plat .. "/" .. config
targetdir (tgtDir)
end
end
os.mkdir("./" .. outFolderRoot)
-- SUBPROJECTS
project "BrofilerCore"
uuid "830934D9-6F6C-C37D-18F2-FB3304348F00"
defines { "_CRT_SECURE_NO_WARNINGS", "BROFILER_LIB=1" }
if _OPTIONS['platform'] ~= "orbis" then
-- kind "SharedLib"
-- defines { "PROFILER_EXPORTS" }
-- else
kind "StaticLib"
end
if isVisualStudio then
buildoptions {
"/wd4091" -- 'typedef ': ignored on left of '' when no variable is declared
}
end
includedirs
{
"ThirdParty/TaskScheduler/Scheduler/Include",
"BrofilerCore"
}
files {
"BrofilerCore/**.cpp",
"BrofilerCore/**.h",
}
vpaths {
["API"] = {
"BrofilerCore/Brofiler.h",
},
["Core"] = {
"BrofilerCore/Core.h",
"BrofilerCore/Core.cpp",
"BrofilerCore/ETW.h",
"BrofilerCore/Event.h",
"BrofilerCore/Event.cpp",
"BrofilerCore/EventDescription.h",
"BrofilerCore/EventDescription.cpp",
"BrofilerCore/EventDescriptionBoard.h",
"BrofilerCore/EventDescriptionBoard.cpp",
"BrofilerCore/Sampler.h",
"BrofilerCore/Sampler.cpp",
"BrofilerCore/SymEngine.h",
"BrofilerCore/SymEngine.cpp",
},
["Network"] = {
"BrofilerCore/Message.h",
"BrofilerCore/Message.cpp",
"BrofilerCore/ProfilerServer.h",
"BrofilerCore/ProfilerServer.cpp",
"BrofilerCore/Socket.h",
"BrofilerCore/Serialization.h",
"BrofilerCore/Serialization.cpp",
},
["System"] = {
"BrofilerCore/Common.h",
"BrofilerCore/Concurrency.h",
"BrofilerCore/HPTimer.h",
"BrofilerCore/HPTimer.cpp",
"BrofilerCore/MemoryPool.h",
"BrofilerCore/Thread.h",
"BrofilerCore/Types.h",
},
}
project "TaskScheduler"
excludes { "ThirdParty/TaskScheduler/Scheduler/Source/MTDefaultAppInterop.cpp", }
kind "StaticLib"
flags {"NoPCH"}
defines {"USE_BROFILER=1"}
files {
"ThirdParty/TaskScheduler/Scheduler/**.*",
}
includedirs
{
"ThirdParty/TaskScheduler/Scheduler/Include",
"BrofilerCore"
}
excludes { "Src/Platform/Posix/**.*" }
vpaths {
["*"] = "TaskScheduler"
}
links {
"BrofilerCore",
}
project "BrofilerTest"
flags {"NoPCH"}
kind "StaticLib"
uuid "9A313DD9-8694-CC7D-2F1A-05341B5C9800"
files {
"BrofilerTest/**.*",
}
includedirs
{
"BrofilerCore",
"ThirdParty/TaskScheduler/Scheduler/Include"
}
links {
"BrofilerCore",
"TaskScheduler",
"BrofilerCore"
}
if isUWP then
-- Genie can't generate proper UWP application
-- It's a dummy project to match existing project file
project "BrofilerDurangoTest"
location( "BrofilerDurangoTest" )
kind "WindowedApp"
uuid "5CA6AF66-C2CB-412E-B335-B34357F2FBB6"
files {
"BrofilerDurangoTest/**.*",
}
else
project "BrofilerWindowsTest"
flags {"NoPCH"}
kind "ConsoleApp"
uuid "C50A1240-316C-EF4D-BAD9-3500263A260D"
files {
"BrofilerWindowsTest/**.*",
"ThirdParty/TaskScheduler/Scheduler/Source/MTDefaultAppInterop.cpp",
}
vpaths {
["*"] = "BrofilerWindowsTest"
}
includedirs {
"BrofilerCore",
"BrofilerTest",
"ThirdParty/TaskScheduler/Scheduler/Include"
}
links {
"BrofilerCore",
"BrofilerTest",
"TaskScheduler"
}
end