From e43e3e3ff780d130a1e1402ed9eabf0aa54c5c1d Mon Sep 17 00:00:00 2001 From: Akaps316 <48785708+Akaps316@users.noreply.github.com> Date: Fri, 3 Apr 2026 19:54:54 +0530 Subject: 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. --- .../projects/objc/iosapp_framework_rpath/test.lua | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/projects/objc/iosapp_framework_rpath/test.lua (limited to 'tests/projects/objc/iosapp_framework_rpath/test.lua') diff --git a/tests/projects/objc/iosapp_framework_rpath/test.lua b/tests/projects/objc/iosapp_framework_rpath/test.lua new file mode 100644 index 000000000..41e770e68 --- /dev/null +++ b/tests/projects/objc/iosapp_framework_rpath/test.lua @@ -0,0 +1,30 @@ +function main(t) + if not is_host("macosx") then + return t:skip("wrong host platform") + end + + os.execv("xmake", {"f", "-p", "iphoneos", "-a", "arm64", "--appledev=simulator", "-c"}) + os.execv("xmake", {"-vD"}) + + import("utils.binary.rpath") + local appfile = "build/iphoneos/arm64/release/demo.app/demo" + local rpaths = rpath.list(appfile) + local found_ios = false + local found_macos = false + if rpaths then + for _, p in ipairs(rpaths) do + if p == "@executable_path/Frameworks" then + found_ios = true + end + if p == "@executable_path/../Frameworks" then + found_macos = true + end + end + end + if not found_ios then + raise("missing iOS framework rpath @executable_path/Frameworks") + end + if found_macos then + raise("found macOS-style framework rpath in iOS app") + end +end -- cgit v1.3.1 From 84061455bdc813d3072afa8a998c8d049840b748 Mon Sep 17 00:00:00 2001 From: Akaps316 <48785708+Akaps316@users.noreply.github.com> Date: Sun, 5 Apr 2026 10:27:42 +0530 Subject: fix(test): move import to top of test.lua per review comment Co-authored-by: Qwen-Coder --- tests/projects/objc/iosapp_framework_rpath/test.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/projects/objc/iosapp_framework_rpath/test.lua') diff --git a/tests/projects/objc/iosapp_framework_rpath/test.lua b/tests/projects/objc/iosapp_framework_rpath/test.lua index 41e770e68..efc69dbea 100644 --- a/tests/projects/objc/iosapp_framework_rpath/test.lua +++ b/tests/projects/objc/iosapp_framework_rpath/test.lua @@ -1,3 +1,5 @@ +import("utils.binary.rpath") + function main(t) if not is_host("macosx") then return t:skip("wrong host platform") @@ -5,8 +7,6 @@ function main(t) os.execv("xmake", {"f", "-p", "iphoneos", "-a", "arm64", "--appledev=simulator", "-c"}) os.execv("xmake", {"-vD"}) - - import("utils.binary.rpath") local appfile = "build/iphoneos/arm64/release/demo.app/demo" local rpaths = rpath.list(appfile) local found_ios = false -- cgit v1.3.1