summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/rules/cuda/devlink/xmake.lua (renamed from xmake/rules/cuda/device_link/xmake.lua)15
-rw-r--r--xmake/rules/cuda/xmake.lua2
2 files changed, 14 insertions, 3 deletions
diff --git a/xmake/rules/cuda/device_link/xmake.lua b/xmake/rules/cuda/devlink/xmake.lua
index 358c42d93..f3ae08bc2 100644
--- a/xmake/rules/cuda/device_link/xmake.lua
+++ b/xmake/rules/cuda/devlink/xmake.lua
@@ -18,8 +18,14 @@
-- @file xmake.lua
--
--- define rule: device-link
-rule("cuda.device_link")
+-- define rule: disable the default device-link
+rule("cuda.nodevlink")
+ before_load(function (target)
+ target:data_set("cuda.nodevlink", true)
+ end)
+
+-- define rule: device-link (default)
+rule("cuda.devlink")
-- add rule: cuda environment
add_deps("cuda.env")
@@ -33,6 +39,11 @@ rule("cuda.device_link")
-- @see https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/
before_link(function (target, opt)
+ -- disable devlink?
+ if target:data("cuda.nodevlink") then
+ return
+ end
+
-- only for binary/shared
local targetkind = target:targetkind()
if targetkind ~= "binary" and targetkind ~= "shared" then
diff --git a/xmake/rules/cuda/xmake.lua b/xmake/rules/cuda/xmake.lua
index 0ec1ddaee..09e4c3fbe 100644
--- a/xmake/rules/cuda/xmake.lua
+++ b/xmake/rules/cuda/xmake.lua
@@ -22,5 +22,5 @@
rule("cuda")
-- add rules
- add_deps("cuda.device_link", "cuda.gencodes")
+ add_deps("cuda.devlink", "cuda.gencodes")