-
Notifications
You must be signed in to change notification settings - Fork 22
/
xmake.lua
51 lines (38 loc) · 1.15 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
-- set project
set_project("nifly")
set_languages("c++17")
set_license("GPL-3.0")
-- define options
option("tests", { default = false, description = "Enable tests" })
-- require packages
add_requires("half", "miniball")
if has_config("tests") then
add_requires("catch2 v2.13.10")
end
-- define targets
target("nifly", function()
set_kind("static")
-- bind package dependencies
add_packages("half", "miniball", { public = true })
-- add all source files
add_files("src/**.cpp")
-- add all header files
add_includedirs("include", { public = true })
add_headerfiles("include/(**.hpp)", { prefixdir = "nifly" })
-- add flags
add_cxxflags("cl::/Zc:inline", "cl::/bigobj")
end)
if has_config("tests") then
target("nifly-tests", function()
-- add target dependencies
add_deps("nifly")
-- bind package dependencies
add_packages("catch2")
-- add all source files, except TestNifFileOptional
add_files("tests/*.cpp|TestNifFileOptional.cpp")
-- add all header files
add_includedirs("tests")
-- set run directory
set_rundir("tests")
end)
end