summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools
diff options
context:
space:
mode:
authorruki <[email protected]>2017-08-18 22:33:24 +0800
committerruki <[email protected]>2017-08-18 22:33:32 +0800
commit24ef8913953a7c49fb1216ac086dbe7ca955155f (patch)
treef7c853c8f1829d77a60b9cbb820fc5a1c2b11039 /xmake/modules/core/tools
parentc049bcb7fc2e2e032ebc69897e5170c214bf8df2 (diff)
support @loader_path and ORIGIN
Diffstat (limited to 'xmake/modules/core/tools')
-rw-r--r--xmake/modules/core/tools/gcc.lua7
1 files changed, 2 insertions, 5 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 1139bed0b..821cc77ce 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -234,16 +234,13 @@ end
-- make the rpathdir flag
function nf_rpathdir(self, dir)
- if self:has_flags(flag_elf) then
+ if self:has_flags("-Wl,-rpath=" .. dir) then
return "-Wl,-rpath=" .. (dir:gsub("@[%w_]+", function (name)
local maps = {["@loader_path"] = "$ORIGIN", ["@executable_path"] = "$ORIGIN"}
return maps[name]
end))
elseif self:has_flags("-Xlinker -rpath -Xlinker " .. dir) then
- return "-Xlinker -rpath -Xlinker " .. (dir:gsub("%$[%w_]+", function (name)
- local maps = {["$ORIGIN"] = "@loader_path"}
- return maps[name]
- end))
+ return "-Xlinker -rpath -Xlinker " .. (dir:gsub("%$ORIGIN", "@loader_path"))
end
end