-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
45 lines (39 loc) · 1.18 KB
/
xmake.lua
File metadata and controls
45 lines (39 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
-- xmake.lua
toolchain("iluvatar.toolchain")
set_toolset("cc", "clang")
set_toolset("cxx", "clang++")
set_toolset("cu", "clang++")
set_toolset("culd", "clang++")
set_toolset("cu-ccbin", "$(env CXX)", "$(env CC)")
toolchain_end()
rule("iluvatar.env")
add_deps("cuda.env", {order = true})
after_load(function (target)
local old = target:get("syslinks")
local new = {}
for _, link in ipairs(old) do
if link ~= "cudadevrt" then
table.insert(new, link)
end
end
if #old > #new then
target:set("syslinks", new)
local log = "cudadevrt removed, syslinks = { "
for _, link in ipairs(new) do
log = log .. link .. ", "
end
log = log:sub(1, -3) .. " }"
print(log)
end
end)
rule_end()
target("test_iluvatar")
set_kind("binary")
set_toolchains("iluvatar.toolchain")
add_rules("iluvatar.env")
set_values("cuda.rdc", false)
add_cuflags("-fPIC", "-x", "ivcore", "-std=c++17", {force = true})
add_culdflags("-fPIC")
add_links("cudart")
add_files("test_iluvatar.cu")
target_end()