Repository navigation
Expand file tree
/
Copy pathmake.lua
More file actions
132 lines (115 loc) · 2.48 KB
/
Copy pathmake.lua
File metadata and controls
132 lines (115 loc) · 2.48 KB
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
local lm = require "luamake"
lm:required_version "1.4"
lm.mode = "debug"
--lm.optimize = "speed"
lm.compile_commands = "build"
lm.visibility = "default"
lm.AntDir = lm:path "3rd/ant"
lm.c = "c17"
lm.cxx = "c++20"
if lm.os == "ios" then
lm.arch = "arm64"
lm.sys = "ios16.0"
elseif lm.os == "macos" then
lm.sys = "macos13.0"
end
lm:config "game_config" {
msvc = {
flags = "/utf-8",
},
}
lm.ios = {
flags = {
"-fembed-bitcode",
"-fobjc-arc"
}
}
lm.android = {
flags = "-fPIC",
}
if lm.os == "android" then
lm.arch = "aarch64"
lm.vendor = "linux"
lm.sys = "android33"
end
local plat = (function ()
if lm.os == "windows" then
if lm.compiler == "gcc" then
return "mingw"
end
return "msvc"
end
if lm.os == "android" then
return lm.os.."-"..lm.arch
end
return lm.os
end)()
lm.builddir = ("build/%s/%s"):format(plat, lm.mode)
lm.bindir = ("bin/%s/%s"):format(plat, lm.mode)
lm.configs = {
"game_config",
}
local EnableSanitize = false
if EnableSanitize then
lm.builddir = ("build/%s/sanitize"):format(plat)
lm.bindir = ("bin/%s/sanitize"):format(plat)
lm.mode = "debug"
lm:config "sanitize" {
flags = "-fsanitize=address",
gcc = {
ldflags = "-fsanitize=address"
},
clang = {
ldflags = "-fsanitize=address"
}
}
lm.configs = {
"game_config",
"sanitize"
}
lm:msvc_copydll "copy_asan" {
type = "asan",
output = lm.bindir,
}
end
lm:import(lm.AntDir .. "/make.lua")
lm:import "clibs/make.lua"
if lm.os == "windows" then
lm:copy "copy_dll" {
input = {
lm.AntDir .. "/3rd/fmod/windows/core/lib/x64/fmod.dll",
lm.AntDir .. "/3rd/fmod/windows/studio/lib/x64/fmodstudio.dll",
lm.AntDir .. "/3rd/vulkan/x64/vulkan-1.dll",
},
output = {
lm.bindir .. "/fmod.dll",
lm.bindir .. "/fmodstudio.dll",
lm.bindir .. "/vulkan-1.dll",
},
}
lm:default {
"copy_dll",
lm.compiler == "msvc" and EnableSanitize and "copy_asan",
"vaststars_rt",
"vaststars",
}
return
end
if lm.os == "ios" then
lm:default {
"bgfx-lib",
"vaststars",
}
return
end
if lm.os == "android" then
lm:default {
"vaststars",
}
return
end
lm:default {
"vaststars_rt_static",
"vaststars_rt",
"vaststars",
}