From ee3d9eec62839bf19f5e44b45b2b8749e51f318b Mon Sep 17 00:00:00 2001 From: Hoildkv <42310255+xq114@users.noreply.github.com> Date: Sat, 15 Jan 2022 13:52:39 +0800 Subject: improve cuda.build.devlink --- xmake/rules/cuda/devlink/xmake.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xmake/rules/cuda/devlink/xmake.lua b/xmake/rules/cuda/devlink/xmake.lua index 2f24f3f2b..67c7836eb 100644 --- a/xmake/rules/cuda/devlink/xmake.lua +++ b/xmake/rules/cuda/devlink/xmake.lua @@ -37,14 +37,14 @@ rule("cuda.build.devlink") import("utils.progress") -- disable devlink? - if target:values("cuda.build.devlink") == false then + local devlink = target:values("cuda.build.devlink") + if devlink == false then return end -- only for binary/shared on non-windows platforms -- https://github.com/xmake-io/xmake/issues/1976 - local targetkind = target:kind() - if target:values("cuda.build.devlink") != true and not target:is_plat("windows") and targetkind ~= "binary" and targetkind ~= "shared" then + if not (devlink == true or target:is_plat("windows") or target:is_binary() or target:is_shared()) then return end @@ -55,7 +55,7 @@ rule("cuda.build.devlink") local culdflags = {"-dlink"} -- add shared flag - if targetkind == "shared" then + if target:is_shared() then table.insert(culdflags, "-shared") end -- cgit v1.3.1