-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
58 lines (51 loc) · 1.84 KB
/
xmake.lua
File metadata and controls
58 lines (51 loc) · 1.84 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
set_project("ESTstack")
set_description("An algorithm set focus on estimation and filtering.")
set_version("0.0.1")
set_xmakever("2.9.8")
set_license("Apache-2.0")
set_defaultplat("linux")
set_languages("c11", "c++20")
add_rules("mode.debug", "mode.release")
if is_mode("debug") then
set_symbols("debug")
set_optimize("none")
add_cxflags("-g")
elseif is_mode("release") then
set_optimize("fastest")
add_cxflags("-march=native", "-flto=auto", "-fopenmp", "-w")
add_ldflags("-flto=auto", "-fopenmp")
end
option("test")
set_default(false)
set_showmenu(true)
set_description("Enable building unit tests.")
option_end()
if has_config("test") then
add_requires("gtest 1.17.0", {configs = {main = true}})
add_requires("backward-cpp v1.6")
end
add_requires("eigen 5.0.0", "pcl 1.15.1", "manif 0.0.5")
add_requires("tbb", {system = true})
add_requireconfs("manif.eigen", {override = true}) -- use eigen from xmake package
namespace("fosu-awakelion")
target("ESTstack")
set_kind("headeronly")
add_includedirs("include", "include/3rdparty", {public = true})
add_headerfiles("include/eststack/**/*.hpp", {public = true})
-- dependencies
add_packages("eigen", "pcl", "manif", "tbb", {public = true})
if has_config("test") then
for _, file in ipairs(os.files("test/*.cpp")) do
local name = path.basename(file)
local target_name = "ESTstack-test-" .. name
target(target_name)
set_kind("binary")
set_default(false)
add_files(file)
add_deps("ESTstack")
add_packages("gtest", "backward-cpp")
set_rundir("$(projectdir)")
add_tests(target_name, {runargs = {"--gtest_color=yes"}})
end
end
namespace_end() -- namespace fosu-awakelion