summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2023-10-27 07:30:59 -0500
committerGitHub <[email protected]>2023-10-27 07:30:59 -0500
commita5ed7b6144d1a6318e25e044dc60a391a317470b (patch)
treeb3f0aa984d4e204c315d142c65d8a3855ab8fd32 /xmake/modules
parent1f3b3148942aa52a0467a5433d85304df0b936f5 (diff)
parent30b8576c2930cb1d188c92aed4d6bd74dbd2f644 (diff)
Merge pull request #4327 from wsw0108/soname-rpath
add @rpath to link flags when soname enabled
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/core/tools/gcc.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 1d4a9e8f9..15ce30280 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -494,8 +494,10 @@ function linkargv(self, objectfiles, targetkind, targetfile, flags, opt)
-- add rpath for dylib (macho), e.g. -install_name @rpath/file.dylib
local flags_extra = {}
if targetkind == "shared" and self:is_plat("macosx", "iphoneos", "watchos") then
- table.insert(flags_extra, "-install_name")
- table.insert(flags_extra, "@rpath/" .. path.filename(targetfile))
+ if not table.contains(flags, "-install_name") then
+ table.insert(flags_extra, "-install_name")
+ table.insert(flags_extra, "@rpath/" .. path.filename(targetfile))
+ end
end
-- add `-Wl,--out-implib,outputdir/libxxx.a` for xxx.dll on mingw/gcc