-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
81 lines (64 loc) · 2.28 KB
/
xmake.lua
File metadata and controls
81 lines (64 loc) · 2.28 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
set_project("Hexis")
set_version("0.0.1")
add_rules("mode.debug", "mode.release")
option("shared", { description = "Build as shared library", default = false })
option("unittest", { description = "Build unittest (xmake test)", default = false })
option("math", { description = "Enables the math module", default = false})
set_languages("c++23")
if is_mode("debug") then
set_warnings("allextra", "error")
end
if has_config("unittest") then
add_requires("doctest")
end
target("HXCore")
add_defines("HX_CORE_BUILD")
if has_config("shared") then
set_kind("shared")
add_defines("HX_CORE_SHARED")
else
set_kind("static")
end
add_includedirs("include/", { public = true })
add_headerfiles("include/(Hexis/Core/*.h)", "include/(Hexis/Core/*.inl)")
add_headerfiles("include/(Hexis/Core/**/*.h)", "include/(Hexis/Core/**/*.inl)")
add_files("src/Core/*.cpp")
add_files("src/Core/**/*.cpp")
if (has_config("unittest")) then
for _, file in ipairs(os.files("test/Core/test_*.cpp")) do
add_tests(path.basename(file), {
kind = "binary",
files = file,
languages = "c++23",
packages = "doctest",
defines = "DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN"
})
end
end
if has_config("math") then
target("HXMath")
add_defines("HX_MATH_BUILD")
if has_config("shared") then
set_kind("shared")
add_defines("HX_MATH_SHARED")
else
set_kind("static")
end
add_deps("HXCore")
add_includedirs("include/", { public = true })
add_headerfiles("include/(Hexis/Math/*.h)", "include/(Hexis/Math/*.inl)")
--add_headerfiles("include/(Hexis/Core/**/*.h)")
add_files("src/Math/*.cpp")
add_files("src/Math/**/*.cpp")
if (has_config("unittest")) then
for _, file in ipairs(os.files("test/Math/test_*.cpp")) do
add_tests(path.basename(file), {
kind = "binary",
files = file,
languages = "c++23",
packages = "doctest",
defines = "DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN"
})
end
end
end