-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
47 lines (40 loc) · 1.18 KB
/
xmake.lua
File metadata and controls
47 lines (40 loc) · 1.18 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
add_rules("mode.debug", "mode.release")
set_toolchains("llvm")
set_languages("c++23")
add_cxxflags("-stdlib=libc++","-fexceptions","-frtti")
add_ldflags("-stdlib=libc++", "-lc++", "-lc++abi")
add_syslinks("pthread")
add_requires("asio", "cxxopts")
option("type")
set_default("infantry")
set_showmenu(true)
set_description("指定要编译的机器人类型")
set_values("infantry","hero","sentry","project")
after_check(function(option)
local val = option:value()
local type = 0
if val == "infantry" then
type = 1
elseif val == "hero" then
type = 2
elseif val == "sentry" then
type = 3
elseif val == "project" then
type = 4
else
raise("Invaild type : " .. val)
end
option:add("defines", "BUILD_TYPE=" .. type)
end)
target("gkd-roboctrl")
set_kind("binary")
add_files("src/**.cpp")
add_includedirs("include")
add_packages("asio", "cxxopts")
add_options("type")
if get_config("type") then
set_basename("gkd.roboctrl." .. get_config("type"))
end
if is_mode("debug") then
add_defines("DEBUG")
end