-
Notifications
You must be signed in to change notification settings - Fork 64
/
make.lua
115 lines (103 loc) · 2.24 KB
/
make.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
local lm = require "luamake"
lm:required_version "1.6"
lm.compile_commands = "build"
lm.AntDir = lm:path "3rd/ant"
lm:conf {
mode = "debug",
visibility = "default",
c = "c17",
cxx = "c++20",
macos = {
sys = "macos13.3",
},
ios = {
arch = "arm64",
sys = "ios16.3",
flags = {
"-fembed-bitcode",
"-fobjc-arc"
}
},
android = {
flags = "-fPIC",
arch = "aarch64",
vendor = "linux",
sys = "android33",
}
}
-- lm:conf {
-- optimize = "speed",
-- defines = {
-- "NDEBUG"
-- }
-- }
local plat = (function ()
if lm.os == "windows" then
if lm.compiler == "gcc" then
return "mingw"
end
if lm.cc == "clang-cl" then
return "clang-cl"
end
return "msvc"
end
if lm.os == "android" then
return "android-"..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)
if lm.sanitize then
lm.builddir = ("build/%s/sanitize"):format(plat)
lm.bindir = ("bin/%s/sanitize"):format(plat)
lm.mode = "debug"
lm:conf {
flags = "-fsanitize=address",
gcc = {
ldflags = "-fsanitize=address"
},
clang = {
ldflags = "-fsanitize=address"
}
}
lm:msvc_copydll "copy_asan_v2" {
type = "asan",
outputs = lm.bindir,
}
end
lm:import(lm.AntDir .. "/make.lua")
lm:import "clibs/make.lua"
if lm.os == "windows" then
lm:copy "copy_dll" {
inputs = {
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",
},
outputs = {
"$bin/fmod.dll",
"$bin/fmodstudio.dll",
"$bin/vulkan-1.dll",
},
}
lm:default {
"ant",
"copy_dll",
"lua54",
"vaststars",
lm.sanitize and "copy_asan_v2",
}
return
end
if lm.os == "ios" then
lm:default {
"bgfx-lib",
"vaststars",
}
return
end
lm:default {
"ant",
"vaststars",
}