forked from ejoy/ant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.lua
113 lines (96 loc) · 1.78 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
local lm = require "luamake"
lm:required_version "1.5"
local plat = (function ()
if lm.os == "windows" then
if lm.compiler == "gcc" then
return "mingw"
end
return "msvc"
end
return lm.os
end)()
lm.mode = "debug"
lm.builddir = ("build/%s/%s"):format(plat, lm.mode)
lm.bindir = ("bin/%s/%s"):format(plat, lm.mode)
lm.compile_commands = "build"
lm.AntDir = lm:path "."
local EnableEditor = true
if lm.os == "ios" then
lm.arch = "arm64"
lm.sys = "ios15.0"
EnableEditor = false
end
if lm.os == "android" then
EnableEditor = false
end
lm.c = "c17"
lm.cxx = "c++20"
lm.msvc = {
defines = {
"_CRT_SECURE_NO_WARNINGS",
"_WIN32_WINNT=0x0601",
},
flags = {
"-wd5105"
}
}
lm:config "engine_config" {
msvc = {
flags = "/utf-8",
},
}
lm.configs = {
"engine_config",
--"sanitize"
}
if lm.mode == "release" then
lm.msvc.ldflags = {
"/DEBUG:FASTLINK"
}
end
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
--TODO
lm.visibility = "default"
lm:import "runtime/make.lua"
lm:runlua "compile_ecs" {
script = "clibs/ecs/ecs_compile.lua",
args = {
lm.AntDir,
"$out",
"@pkg",
},
inputs = "pkg/**/*.ecs",
output = "clibs/ecs/ecs/component.hpp",
}
if EnableEditor then
lm:phony "tools" {
deps = {
"gltf2ozz",
"shaderc",
"texturec",
}
}
lm:phony "all" {
deps = {
"editor",
"runtime",
"tools",
}
}
lm:default "editor"
else
lm:default "runtime"
end