diff options
| author | Arthur LAURENT <[email protected]> | 2024-03-07 12:04:54 +0100 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2024-03-07 12:06:18 +0100 |
| commit | c41b27e31ea3f52a9b9ae69809aeb431d6e5fe9b (patch) | |
| tree | 10919881b2300a08806b918a166243cc79a79ae1 | |
| parent | b4c3a3eb56fe7a00a49706c37121d0125d84d09f (diff) | |
improve rpath support for clang macOS
| -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 |
