diff options
| author | ruki <[email protected]> | 2022-08-23 00:55:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-23 00:55:41 +0800 |
| commit | 1a870edea963e755c2e0b6983f0c0c1395ad06e7 (patch) | |
| tree | 999a9a32834f1b0a5d5a10683b7260a19fdbd4b1 /xmake/modules/core/tools/gcc.lua | |
| parent | 22097d49e8a8ff60a8535005c3c3e5b713b2bd42 (diff) | |
improve rpath for framework
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 4122c8ae8..7dfaab07f 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -350,13 +350,14 @@ 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 is_plat("macosx", "iphoneos", "watchos") then + local plat = self:plat() + if targetkind == "shared" and (plat == "macosx" or plat == "iphoneos" or plat == "watchos") then table.insert(flags_extra, "-install_name") table.insert(flags_extra, "@rpath/" .. path.filename(targetfile)) end -- add `-Wl,--out-implib,outputdir/libxxx.a` for xxx.dll on mingw/gcc - if targetkind == "shared" and is_plat("mingw") then + if targetkind == "shared" and plat == "mingw" then table.insert(flags_extra, "-Wl,--out-implib," .. path.join(path.directory(targetfile), path.basename(targetfile) .. ".dll.a")) end |
