summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-06-12 23:00:12 +0800
committerruki <[email protected]>2019-06-12 12:01:13 +0800
commita42d2ff6c4b54bc63a4126c9f61ad83b7cb0f18a (patch)
tree142cae9931f1021ca79880686f7f81a70616045b
parentb7e3a9836f2b4dc7fa034506fbef863ff519de69 (diff)
add cuda.nodevlink rule
-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")