-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmake.lua
108 lines (81 loc) · 2.21 KB
/
xmake.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
-- defines:
-- AME_NO_IMGUI: disable imgui
-- AME_NO_EXCEPTIONS: disable exceptions
--
rule("csharp")
set_extensions(".csproj", ".cs")
rule_end()
--
set_languages("cxxlatest")
add_rules("mode.debug", "mode.releasedbg", "mode.check")
set_policy("install.strip_packagelibs", false)
--
includes("Project/Utils.lua")
--
_script_root_dir = os.scriptdir()
_debug_packages = false
_with_symbols = false
_use_exception = false
_vc_runtime = ""
--
add_defines("NOMINMAX")
set_warnings("allextra", "error")
--
set_exceptions("cxx")
_use_exception = true
if is_mode("debug") then
add_defines("AME_DEBUG")
set_symbols("debug", "edit")
set_runtimes("MDd")
_debug_packages = true
_with_symbols = true
elseif is_mode("check") then
add_defines("AME_DEBUG")
add_defines("AME_DEBUG_SANITIZE")
set_symbols("debug")
set_runtimes("MDd")
_debug_packages = true
_with_symbols = true
elseif is_mode("releasedbg") then
add_defines("AME_RELEASE")
set_symbols("debug")
set_runtimes("MD")
_with_symbols = true
elseif is_mode("release") then
add_defines("AME_DIST")
set_symbols("hidden")
set_runtimes("MD")
end
--
if is_plat("windows") then
add_defines("AME_PLATFORM_WINDOWS")
elseif is_plat("linux") then
add_defines("AME_PLATFORM_LINUX")
end
-- comprimise until a fix for https://github.com/SanderMertens/flecs/issues/1032 is found
-- flecs component's id are static and can't be used in multiple dlls
-- add_defines("FLECS_CPP_NO_AUTO_REGISTRATION")
--
-- linking for asan, adding directory of clang_rt.asan
if is_mode("check") then
on_load(function (target)
local msvc = target:toolchain("msvc")
if msvc then
local runenvs = msvc:runenvs()
if runenvs then
local lib_path = runenvs["LIB"]
-- split by ';' lib_path
for cur_path in lib_path:gmatch("([^;]+)") do
target:add("linkdirs", cur_path)
end
end
end
end)
end
--
local clang_format = file_utils:path_from_root(".clang-format")
local clang_tidy = file_utils:path_from_root(".clang-tidy")
add_extrafiles(clang_format)
add_extrafiles(clang_tidy)
--
includes("Project/Ame.lua")