summaryrefslogtreecommitdiff
path: root/xmake/toolchains/cuda/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-05-08 16:01:27 +0800
committerruki <[email protected]>2021-05-08 16:07:12 +0800
commitcab3fb99fdc5a4a9fd97437cf4ed8a232a12ebc9 (patch)
treef731b841ee1825620b73d410dd138f1580b8fe93 /xmake/toolchains/cuda/xmake.lua
parent76d737fcc850ba14de9ca18cdb49c7bfbf3e6620 (diff)
improve nvcc
Diffstat (limited to 'xmake/toolchains/cuda/xmake.lua')
-rw-r--r--xmake/toolchains/cuda/xmake.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/toolchains/cuda/xmake.lua b/xmake/toolchains/cuda/xmake.lua
index f7bd54cd0..ca25dcb74 100644
--- a/xmake/toolchains/cuda/xmake.lua
+++ b/xmake/toolchains/cuda/xmake.lua
@@ -30,3 +30,14 @@ toolchain("cuda")
set_toolset("culd", "nvcc")
set_toolset("cu-ccbin", "$(env CXX)", "$(env CC)", "clang", "gcc")
+ -- bind msvc environments, because nvcc will call cl.exe
+ on_load(function (toolchain)
+ if toolchain:is_plat("windows") then
+ import("core.tool.toolchain", {alias = "core_toolchain"})
+ local msvc = core_toolchain.load("msvc", {plat = toolchain:plat(), arch = toolchain:arch()})
+ for name, values in pairs(msvc:runenvs()) do
+ toolchain:add("runenvs", name, values)
+ end
+ end
+ end)
+