summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/core/tools/gcc.lua9
1 files changed, 1 insertions, 8 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 4f6eb903f..a6a7247fb 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -488,14 +488,7 @@ 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
- local soname_enabled = false
- for _, v in pairs(flags) do
- if string.find(v, "-install_name") then
- soname_enabled = true
- break
- end
- end
- if not soname_enabled then
+ if not table.contains(flags, "-install_name") then
table.insert(flags_extra, "-install_name")
table.insert(flags_extra, "@rpath/" .. path.filename(targetfile))
end