summaryrefslogtreecommitdiff
path: root/xmake/rules/xcode/application/build.lua
diff options
context:
space:
mode:
authorAkaps316 <[email protected]>2026-04-05 10:38:00 +0530
committerAkaps316 <[email protected]>2026-04-05 10:38:00 +0530
commitd0f83e55778e37afc767cf8fa382e16d6e5dc001 (patch)
tree87310d2c190ddf6c5d73defee3e6d0af447b45fa /xmake/rules/xcode/application/build.lua
parent84061455bdc813d3072afa8a998c8d049840b748 (diff)
fix(xcode.application): resolve merge conflict with upstream dev - add rpath duplicate guard
Co-authored-by: Qwen-Coder <[email protected]>
Diffstat (limited to 'xmake/rules/xcode/application/build.lua')
-rw-r--r--xmake/rules/xcode/application/build.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/rules/xcode/application/build.lua b/xmake/rules/xcode/application/build.lua
index 7d1c836fa..d55d71a9c 100644
--- a/xmake/rules/xcode/application/build.lua
+++ b/xmake/rules/xcode/application/build.lua
@@ -23,6 +23,7 @@ import("core.base.option")
import("core.theme.theme")
import("core.project.depend")
import("private.tools.codesign")
+import("utils.binary.rpath", {alias = "rpath_utils"})
import("utils.progress")
function main (target, opt)
@@ -49,8 +50,13 @@ function main (target, opt)
-- @see https://github.com/xmake-io/xmake/issues/2679#issuecomment-1221839215
local targetfile = path.join(binarydir, path.filename(target:targetfile()))
try { function () os.vrunv("install_name_tool", {"-delete_rpath", "@loader_path", targetfile}) end }
+ -- macOS uses @executable_path/../Frameworks due to Contents/MacOS/ layout
+ -- iOS/watchOS/tvOS/visionOS use flat bundle layout where frameworks are in the same directory as the executable
local rpath = target:is_plat("macosx") and "@executable_path/../Frameworks" or "@executable_path/Frameworks"
- os.vrunv("install_name_tool", {"-add_rpath", rpath, targetfile})
+ local rpathdirs = rpath_utils.list(targetfile, {plat = target:plat(), arch = target:arch()}) or {}
+ if not table.contains(rpathdirs, rpath) then
+ os.vrunv("install_name_tool", {"-add_rpath", rpath, targetfile})
+ end
-- copy dependent dynamic libraries and frameworks
for _, dep in ipairs(target:orderdeps()) do