summaryrefslogtreecommitdiff
path: root/xmake/rules/xcode/application
diff options
context:
space:
mode:
authorAkaps316 <[email protected]>2026-04-03 19:54:54 +0530
committerAkaps316 <[email protected]>2026-04-04 20:24:39 +0530
commite43e3e3ff780d130a1e1402ed9eabf0aa54c5c1d (patch)
treeda7d68aab4b2aa406f71ac4f713bd2be29000d24 /xmake/rules/xcode/application
parent39fd35ea9d5d14079e4669b85423d488c9097cd4 (diff)
fix(xcode.application): use the correct framework rpath for iOS apps
Use @executable_path/Frameworks for iphoneos application bundles when embedding dependent frameworks. The existing @executable_path/../Frameworks rpath is correct for macOS app layout, but incorrect for iOS where the executable lives directly in MyApp.app and embedded frameworks live in MyApp.app/Frameworks. Add a regression test that builds an iOS simulator app with an embedded framework and verifies the generated LC_RPATH.
Diffstat (limited to 'xmake/rules/xcode/application')
-rw-r--r--xmake/rules/xcode/application/build.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/rules/xcode/application/build.lua b/xmake/rules/xcode/application/build.lua
index 8ea734d28..7d1c836fa 100644
--- a/xmake/rules/xcode/application/build.lua
+++ b/xmake/rules/xcode/application/build.lua
@@ -49,7 +49,8 @@ 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 }
- os.vrunv("install_name_tool", {"-add_rpath", "@executable_path/../Frameworks", targetfile})
+ local rpath = target:is_plat("macosx") and "@executable_path/../Frameworks" or "@executable_path/Frameworks"
+ os.vrunv("install_name_tool", {"-add_rpath", rpath, targetfile})
-- copy dependent dynamic libraries and frameworks
for _, dep in ipairs(target:orderdeps()) do
@@ -109,4 +110,3 @@ function main (target, opt)
end, {dependfile = target:dependfile(bundledir), files = {bundledir, target:targetfile()}, changed = target:is_rebuilt()})
end
-