summaryrefslogtreecommitdiff
path: root/xmake/platforms/linux/config.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-05-18 00:27:34 +0800
committerruki <[email protected]>2019-05-17 20:45:25 +0800
commit9c464b2ebdf56f4da8202b419db18105e86d45e3 (patch)
treee0facad4366513d560bdf0e68d9d0e61675d42f9 /xmake/platforms/linux/config.lua
parent873c3409ac000da83f057342abf656cb79c3d47f (diff)
add --cu-cxx to nvcc/-ccbin
Diffstat (limited to 'xmake/platforms/linux/config.lua')
-rw-r--r--xmake/platforms/linux/config.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/xmake/platforms/linux/config.lua b/xmake/platforms/linux/config.lua
index fb1ae10a2..60cc98676 100644
--- a/xmake/platforms/linux/config.lua
+++ b/xmake/platforms/linux/config.lua
@@ -78,12 +78,13 @@ function _toolchains()
local cu = toolchain("the cuda compiler")
local cu_ld = toolchain("the cuda linker")
local cu_sh = toolchain("the cuda shared library linker")
+ local cu_cxx = toolchain("the cuda host c++ compiler")
local toolchains = {cc = cc, cxx = cxx, as = as, ld = ld, sh = sh, ar = ar, ex = ex,
mm = mm, mxx = mxx,
gc = gc, ["gc-ld"] = gc_ld, ["gc-ar"] = gc_ar,
dc = dc, ["dc-ld"] = dc_ld, ["dc-sh"] = dc_sh, ["dc-ar"] = dc_ar,
rc = rc, ["rc-ld"] = rc_ld, ["rc-sh"] = rc_sh, ["rc-ar"] = rc_ar,
- cu = cu, ["cu-ld"] = cu_ld, ["cu-sh"] = cu_sh}
+ cu = cu, ["cu-ld"] = cu_ld, ["cu-sh"] = cu_sh, ["cu-cxx"] = cu_cxx}
-- init the c compiler
cc:add("$(env CC)", {name = "gcc", cross = cross}, {name = "clang", cross = cross})
@@ -149,6 +150,9 @@ function _toolchains()
cu:add("nvcc")
cu_ld:add("nvcc")
cu_sh:add("nvcc")
+ if not cross or cross == "" then
+ cu_cxx:add("$(env CXX)", "$(env CC)", "gcc", "clang", "g++", "clang++")
+ end
return toolchains
end
@@ -169,6 +173,12 @@ function main(platform, name)
-- check cuda
check_cuda(config)
+
+ -- check cu-cxx after checking arch
+ if config.get("cuda") then
+ local toolchains = singleton.get("linux.toolchains", _toolchains)
+ check_toolchain(config, "cu-cxx", toolchains["cu-cxx"])
+ end
end
end