summaryrefslogtreecommitdiff
path: root/xmake/rules/cuda/device_link/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-06-11 00:54:39 +0800
committerruki <[email protected]>2019-06-10 23:27:58 +0800
commitf42f1b5a97f5fdbac4d74a2e43a32fcc71cee0c3 (patch)
tree4bd1cdcdc1f8db843720686133666bd9c0098d37 /xmake/rules/cuda/device_link/xmake.lua
parent9f81f22e0d241bfc6ddb2f5b55b75ddfbc3f6851 (diff)
improve cuda.env and ignore static kind
Diffstat (limited to 'xmake/rules/cuda/device_link/xmake.lua')
-rw-r--r--xmake/rules/cuda/device_link/xmake.lua21
1 files changed, 6 insertions, 15 deletions
diff --git a/xmake/rules/cuda/device_link/xmake.lua b/xmake/rules/cuda/device_link/xmake.lua
index 90481c34b..068c8270f 100644
--- a/xmake/rules/cuda/device_link/xmake.lua
+++ b/xmake/rules/cuda/device_link/xmake.lua
@@ -24,24 +24,15 @@ rule("cuda.device_link")
-- add rule: cuda environment
add_deps("cuda.env")
- -- after load
- after_load(function (target)
-
- -- get cuda
- local cuda = assert(target:data("cuda"))
-
- -- add links
- target:add("links", "cudadevrt", "cudart_static")
- if is_plat("linux") then
- target:add("links", "rt", "pthread", "dl")
- end
- target:add("linkdirs", cuda.linkdirs)
- target:add("rpathdirs", cuda.linkdirs)
- end)
-
-- @see https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/
before_link(function (target, opt)
+ -- only for binary/shared
+ local targetkind = target:targetkind()
+ if targetkind ~= "binary" and targetkind ~= "shared" then
+ return
+ end
+
-- imports
import("core.base.option")
import("core.theme.theme")