diff options
| -rw-r--r-- | xmake/modules/core/tools/clang.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/clang.lua b/xmake/modules/core/tools/clang.lua index 39f90025b..5da649779 100644 --- a/xmake/modules/core/tools/clang.lua +++ b/xmake/modules/core/tools/clang.lua @@ -314,6 +314,10 @@ function nf_runtime(self, runtime, opt) end end if rpath_flags then + if target:kind() == "shared" and self:is_plat("macosx", "iphoneos", "watchos") then + table.insert(rpath_flags, "-install_name") + table.insert(rpath_flags, "@rpath/" .. path.filename(target:filename())) + end maps["c++_shared"] = table.join(maps["c++_shared"], rpath_flags) end end |
