diff options
| author | wsw0108 <[email protected]> | 2023-10-27 16:05:46 +0800 |
|---|---|---|
| committer | wsw0108 <[email protected]> | 2023-10-27 16:05:46 +0800 |
| commit | 30b8576c2930cb1d188c92aed4d6bd74dbd2f644 (patch) | |
| tree | c3bad8058d76f37a8483407200dbbd9658e73bea /xmake/modules/core/tools/gcc.lua | |
| parent | 985b2a9d54df1ac40a420dc853a7b35cd5e6e377 (diff) | |
use simple api table.contains
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 9 |
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 |
