From 46a694b347199ab39a6693a04a4bcdee00ade063 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 12 Jun 2019 00:09:20 +0800 Subject: add -fPIC to devlink --- xmake/rules/cuda/device_link/xmake.lua | 6 ++++++ 1 file changed, 6 insertions(+) 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}}}) -- cgit v1.3.1