-
Notifications
You must be signed in to change notification settings - Fork 8
/
xmake.lua
61 lines (51 loc) · 1.76 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
set_project("muda")
includes("xmake/options.lua")
includes("xmake/package_requires.lua")
-- **********************************
--
-- targets
--
-- **********************************
set_languages("cxx17")
add_rules("mode.debug", "mode.release")
target("muda")
add_undefines("min","max")
set_kind("headeronly")
add_headerfiles("src/(muda/**.h)","src/(muda/**.inl)", {public = true})
add_includedirs("src/", {public = true})
if(has_config("with_check")) then
add_defines("MUDA_CHECK_ON=1", {public = true})
else
add_defines("MUDA_CHECK_ON=0", {public = true})
end
if(has_config("with_compute_graph")) then
add_defines("MUDA_COMPUTE_GRAPH_ON=1", {public = true})
else
add_defines("MUDA_COMPUTE_GRAPH_ON=0", {public = true})
end
add_packages("cuda", {public = true})
-- add_packages("eigen", {public = true})
add_cuflags("--extended-lambda", {public = true}) -- must be set for muda
add_cuflags("--expt-relaxed-constexpr", {public = true}) -- must be set for muda
add_cuflags("-rdc=true", {public = true})
target_end()
-- include muda_app_base("cui") function
includes("xmake/muda_app_base.lua")
if has_config("test") then
target("muda_unit_test")
muda_app_base("cui")
local test_data_dir = path.absolute("test/data")
add_defines("unit_test_DATA_DIR=R\"(".. test_data_dir..")\"")
add_files("test/unit_test/**.cu","test/unit_test/**.cpp")
target_end()
target("muda_eigen_test")
muda_app_base("cui")
add_files("test/eigen_test/**.cu","test/eigen_test/**.cpp")
target_end()
end
if has_config("example") then
target("muda_example")
muda_app_base("cui")
add_files("example/**.cu","example/**.cpp")
target_end()
end