This repository has been archived by the owner on Jan 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneon-functions.lua
330 lines (288 loc) · 8.16 KB
/
neon-functions.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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
function copy_file_to_target_dir(from_dir, folder, name)
postbuildcommands
{
string.format("{ECHO} Copying %s/%s to $(targetdir)%s%s", from_dir, name, folder, name),
string.format('if not exist "$(targetdir)%s" mkdir "$(targetdir)%s"', folder, folder),
string.format("{COPYFILE} %s/%s $(targetdir)%s%s", from_dir, name, folder, name)
}
end
function copy_directory_to_target_dir(from_dir, to_dir)
if to_dir ~= "" then
filter { "system:windows" }
postbuildcommands
{
string.format("powershell rmdir -R $(targetdir)%s 2>nul", to_dir)
}
filter {}
end
postbuildcommands
{
string.format("{ECHO} Copying %s to $(targetdir)%s", from_dir, to_dir),
string.format('mkdir "$(targetdir)%s"', to_dir),
string.format("{COPY} %s $(targetdir)%s", from_dir, to_dir)
}
end
function copy_engine_resources_to(content_name, out_dir)
-- Copy assets
if content_name ~= nil then
content_name = "%{wks.location}Contents/"..content_name;
copy_directory_to_target_dir(content_name, out_dir);
end
copy_file_to_target_dir("%{wks.location}Vendors/Mono/bin", "", "mono-2.0-sgen.dll")
copy_file_to_target_dir("%{wks.location}Vendors/Mono/bin", "", "MonoPosixHelper.dll")
copy_directory_to_target_dir("%{wks.location}Vendors/Mono/lib/mono", "Managed/mono")
filter { "system:windows" }
filter { "configurations:Debug" }
copy_file_to_target_dir("%{wks.location}Vendors/AssImp/bin/windows/Debug", "", "assimp-vc143-mtd.dll")
filter {}
filter { "configurations:Release or ReleaseOpt" }
copy_file_to_target_dir("%{wks.location}Vendors/AssImp/bin/windows/Release", "", "assimp-vc143-mt.dll")
filter {}
filter {}
filter { "system:windows" }
-- Copy dxcompiler.dll and dxil.dll
copy_file_to_target_dir("%{CommonDir.Deps.Libs}/DxC/bin/x64", "", "dxcompiler.dll")
copy_file_to_target_dir("%{CommonDir.Deps.Libs}/DxC/bin/x64", "", "dxil.dll")
-- Copy D3D12 Agility SDK
copy_file_to_target_dir("%{CommonDir.Deps.Libs}/DxAgility/x64", "D3D12/", "D3D12Core.dll")
copy_file_to_target_dir("%{CommonDir.Deps.Libs}/DxAgility/x64", "D3D12/", "D3D12SDKLayers.dll")
filter { "configurations:not Dist" }
copy_file_to_target_dir("%{CommonDir.Deps.Libs}/DxAgility/x64", "D3D12/", "D3D12Core.pdb")
copy_file_to_target_dir("%{CommonDir.Deps.Libs}/DxAgility/x64", "D3D12/", "D3D12SDKLayers.pdb")
filter {}
filter {}
end
function copy_engine_resources(content_name)
copy_engine_resources_to(content_name, "Contents/");
end
function common_dir_setup()
targetdir ("%{wks.location}/bin/" .. OutputDir .. "/%{prj.name}")
objdir ("%{wks.location}/bin-int/" .. OutputDir .. "/%{prj.name}")
debugdir "$(targetdir)"
disablewarnings
{
"4250"
}
end
function common_add_pch(pch_file)
pchheader (pch_file..".hpp")
pchsource (pch_file..".cpp")
end
function select_launch_kind()
filter { "configurations:Dist" }
kind "WindowedApp"
filter {}
filter { "configurations:not Dist" }
kind "ConsoleApp"
filter {}
end
--
function link_boost_inc()
filter { "configurations:Debug" }
includedirs
{
"%{CommonDir.Deps.Inc}/boost_def"
}
filter {}
filter { "configurations:Release" }
includedirs
{
"%{CommonDir.Deps.Inc}/boost_san"
}
filter {}
filter { "configurations:ReleaseOpt" }
includedirs
{
"%{CommonDir.Deps.Inc}/boost_def"
}
filter {}
filter { "configurations:Dist" }
includedirs
{
"%{CommonDir.Deps.Inc}/boost_def"
}
filter {}
end
function link_boost_lib(lib_name)
filter { "configurations:Debug" }
links
{
"boost_def/boost/libboost_"..lib_name.."-vc143-mt-sgd-x64-1_83.lib"
}
filter {}
filter { "configurations:Release" }
links
{
"boost_san/boost/libboost_"..lib_name.."-vc143-mt-s-x64-1_83.lib"
}
filter {}
filter { "configurations:ReleaseOpt" }
links
{
"boost_def/boost/libboost_"..lib_name.."-vc143-mt-s-x64-1_83.lib"
}
filter {}
filter { "configurations:Dist" }
links
{
"boost_def/boost/libboost_"..lib_name.."-vc143-mt-s-x64-1_83.lib"
}
filter {}
end
--
function link_mono_lib()
links
{
"%{wks.location}/Vendors/Mono/lib/mono-2.0-sgen.lib",
"%{wks.location}/Vendors/Mono/lib/MonoPosixHelper.lib"
}
end
--
function link_assimp_lib()
filter { "system:windows" }
filter { "configurations:Debug" }
links
{
"%{wks.location}/Vendors/AssImp/bin/windows/Debug/assimp-vc143-mtd.lib"
}
filter {}
filter { "configurations:Release or ReleaseOpt" }
links
{
"%{wks.location}/Vendors/AssImp/bin/windows/Release/assimp-vc143-mt.lib"
}
filter {}
filter {}
end
--
function link_engine_library_no_engine()
links
{
"Bullet3Common",
"Bullet3Collision",
"Bullet3Dynamics",
"Bullet3Geometry",
"Bullet3Serialize",
"BulletCollision",
"BulletDynamics",
"BulletInverseDynamics",
"BulletSoftBody",
"BulletLinearMath",
"ImGui",
"ImGuiNodeEditor",
"glfw",
"Flecs",
"spdlog",
"ZipLib",
"NeonCore",
"NeonCoroutines",
"NeonResource",
"NeonWindowing",
"NeonGraphics",
}
link_mono_lib()
link_assimp_lib()
link_boost_lib("atomic")
link_boost_lib("chrono")
link_boost_lib("container")
link_boost_lib("context")
link_boost_lib("contract")
link_boost_lib("coroutine")
link_boost_lib("date_time")
link_boost_lib("exception")
link_boost_lib("fiber")
link_boost_lib("filesystem")
link_boost_lib("graph")
link_boost_lib("iostreams")
link_boost_lib("json")
link_boost_lib("locale")
link_boost_lib("math_c99")
link_boost_lib("math_c99f")
link_boost_lib("math_c99l")
link_boost_lib("math_tr1")
link_boost_lib("math_tr1f")
link_boost_lib("math_tr1l")
link_boost_lib("nowide")
link_boost_lib("program_options")
link_boost_lib("random")
link_boost_lib("regex")
link_boost_lib("serialization")
link_boost_lib("system")
link_boost_lib("thread")
link_boost_lib("timer")
link_boost_lib("type_erasure")
link_boost_lib("url")
link_boost_lib("wave")
link_boost_lib("wserialization")
end
function link_engine_library(with_engine)
link_engine_library_no_engine()
links
{
"NeonEngine"
}
end
--
function common_neon_defines()
defines "flecs_STATIC"
defines "BT_USE_DOUBLE_PRECISION"
defines "GLM_FORCE_LEFT_HANDED"
end
function common_neon_inc()
libdirs "%{CommonDir.Deps.Libs}"
link_boost_inc()
end
function common_neon()
common_neon_defines()
common_neon_inc()
files
{
"**.cpp",
"**.hpp",
"**.natvis"
}
includedirs
{
"%{CommonDir.Deps.Inc}/Bullet3",
"%{CommonDir.Deps.Inc}",
"%{prj.location}",
"%{CommonDir.Neon.Core}",
"%{CommonDir.Neon.Coroutines}",
"%{CommonDir.Neon.Windowing}",
"%{CommonDir.Neon.Graphics}",
"%{CommonDir.Neon.Resource}",
"%{CommonDir.Neon.Engine}"
}
end
function setup_runtime_engine(asset_path_name)
language "C++"
cppdialect "C++latest"
staticruntime "On"
architecture "x64"
select_launch_kind()
common_dir_setup()
common_neon()
link_engine_library()
copy_engine_resources(asset_path_name)
end
--
function setup_csharp_project_impl()
kind "SharedLib"
language "C#"
dotnetframework "4.7.2"
targetdir ("%{wks.location}/bin/" .. OutputDir .. "/%{prj.name}")
objdir ("%{wks.location}/bin-int/" .. OutputDir .. "/%{prj.name}")
debugdir "$(targetdir)"
files
{
"**.cs",
"**.natvis"
}
end
function setup_csharp_project()
setup_csharp_project_impl()
links
{
"NeonEngineS"
}
end