summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-06-12 00:09:20 +0800
committerruki <[email protected]>2019-06-11 18:56:03 +0800
commit46a694b347199ab39a6693a04a4bcdee00ade063 (patch)
tree714ba865af672fb02a7937cc67fbd2ccb6c4642c
parent67987b7da01fe4e2c4b5ae8527008dd854f16c26 (diff)
add -fPIC to devlink
-rw-r--r--xmake/rules/cuda/device_link/xmake.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmake/rules/cuda/device_link/xmake.lua b/xmake/rules/cuda/device_link/xmake.lua
index 0f390f0d9..6921253a3 100644
--- a/xmake/rules/cuda/device_link/xmake.lua
+++ b/xmake/rules/cuda/device_link/xmake.lua
@@ -51,6 +51,12 @@ rule("cuda.device_link")
-- init culdflags
local culdflags = {"-dlink"}
+ if targetkind == "shared" then
+ table.insert(culdflags, "-shared")
+ if not is_plat("windows") then
+ table.insert(culdflags, "-Xcompiler -fPIC")
+ end
+ end
-- get link flags
local linkflags = linkinst:linkflags({target = target, configs = {force = {culdflags = culdflags}}})