summaryrefslogtreecommitdiff
path: root/tests/projects/objc/iosapp_framework_rpath/src
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 /tests/projects/objc/iosapp_framework_rpath/src
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 'tests/projects/objc/iosapp_framework_rpath/src')
-rw-r--r--tests/projects/objc/iosapp_framework_rpath/src/app/Info.plist20
-rw-r--r--tests/projects/objc/iosapp_framework_rpath/src/app/main.m13
-rw-r--r--tests/projects/objc/iosapp_framework_rpath/src/framework/Info.plist18
-rw-r--r--tests/projects/objc/iosapp_framework_rpath/src/framework/test.h3
-rw-r--r--tests/projects/objc/iosapp_framework_rpath/src/framework/test.m3
5 files changed, 57 insertions, 0 deletions
diff --git a/tests/projects/objc/iosapp_framework_rpath/src/app/Info.plist b/tests/projects/objc/iosapp_framework_rpath/src/app/Info.plist
new file mode 100644
index 000000000..64e1f01a8
--- /dev/null
+++ b/tests/projects/objc/iosapp_framework_rpath/src/app/Info.plist
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleExecutable</key>
+ <string>demo</string>
+ <key>CFBundleIdentifier</key>
+ <string>io.xmake.demo.ios</string>
+ <key>CFBundleName</key>
+ <string>demo</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>UIApplicationSceneManifest</key>
+ <dict/>
+</dict>
+</plist>
diff --git a/tests/projects/objc/iosapp_framework_rpath/src/app/main.m b/tests/projects/objc/iosapp_framework_rpath/src/app/main.m
new file mode 100644
index 000000000..44183e7aa
--- /dev/null
+++ b/tests/projects/objc/iosapp_framework_rpath/src/app/main.m
@@ -0,0 +1,13 @@
+#import <UIKit/UIKit.h>
+#import <test/test.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+@property (strong, nonatomic) UIWindow *window;
+@end
+
+@implementation AppDelegate
+@end
+
+int main(int argc, char *argv[]) {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])) + test_value();
+}
diff --git a/tests/projects/objc/iosapp_framework_rpath/src/framework/Info.plist b/tests/projects/objc/iosapp_framework_rpath/src/framework/Info.plist
new file mode 100644
index 000000000..0f3689457
--- /dev/null
+++ b/tests/projects/objc/iosapp_framework_rpath/src/framework/Info.plist
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleExecutable</key>
+ <string>test</string>
+ <key>CFBundleIdentifier</key>
+ <string>io.xmake.test.framework</string>
+ <key>CFBundleName</key>
+ <string>test</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+</dict>
+</plist>
diff --git a/tests/projects/objc/iosapp_framework_rpath/src/framework/test.h b/tests/projects/objc/iosapp_framework_rpath/src/framework/test.h
new file mode 100644
index 000000000..91434eb54
--- /dev/null
+++ b/tests/projects/objc/iosapp_framework_rpath/src/framework/test.h
@@ -0,0 +1,3 @@
+#import <Foundation/Foundation.h>
+
+FOUNDATION_EXPORT int test_value(void);
diff --git a/tests/projects/objc/iosapp_framework_rpath/src/framework/test.m b/tests/projects/objc/iosapp_framework_rpath/src/framework/test.m
new file mode 100644
index 000000000..7b8c414be
--- /dev/null
+++ b/tests/projects/objc/iosapp_framework_rpath/src/framework/test.m
@@ -0,0 +1,3 @@
+int test_value(void) {
+ return 7;
+}