summaryrefslogtreecommitdiffstats
path: root/test cases/osx/4 framework
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/osx/4 framework')
-rw-r--r--test cases/osx/4 framework/meson.build32
-rw-r--r--test cases/osx/4 framework/prog.c3
-rw-r--r--test cases/osx/4 framework/stat.c1
-rw-r--r--test cases/osx/4 framework/test.json6
-rw-r--r--test cases/osx/4 framework/xcode-frameworks.pngbin0 -> 421385 bytes
5 files changed, 42 insertions, 0 deletions
diff --git a/test cases/osx/4 framework/meson.build b/test cases/osx/4 framework/meson.build
new file mode 100644
index 0000000..d1f7036
--- /dev/null
+++ b/test cases/osx/4 framework/meson.build
@@ -0,0 +1,32 @@
+# Primitive test for adding frameworks in XCode
+# When opening the xcodeproj, the Folder "Frameworks" should contain two frameworks (OpenGL.framework and Foundation.framework)
+# "Target Membership" of ...
+# - OpenGL.framework should be only to prog@exe
+# - Foundation.framework should be only to stat@sta
+# "Build Phase" / "Link Binary with Libraries" for the target
+# - "prog@exe" should be only "Foundation.framework"
+# - "stat@sta" should be only "OpenGL.framework"
+# see "xcode-frameworks.png" for an example
+
+project('xcode framework test', 'objc', default_options : ['libdir=libtest'])
+
+dep_main = dependency('appleframeworks', modules : ['Foundation'])
+
+if meson.is_cross_build()
+ # This is only available in iOS, not macOS. Just test finding it.
+ uikit_dep = dependency('appleframeworks', modules: 'UIKit')
+else
+ dep_libs = dependency('appleframeworks', modules : ['OpenGL'], required : false)
+ if not dep_libs.found()
+ error('OpenGL framework not found')
+ endif
+ assert(dep_libs.type_name() == 'appleframeworks', 'type_name is wrong')
+ # Only add the C compiler now, to ensure all lookups above were done with the ObjC one.
+ add_languages('c')
+ stlib = static_library('stat', 'stat.c', install : true, dependencies: dep_libs)
+ exe = executable('prog', 'prog.c', install : true, dependencies: dep_main)
+ uikit_dep = dependency('appleframeworks', modules: 'UIKit', required: false)
+ if uikit_dep.found()
+ error('UIKit found on macOS even though it should not be there.')
+ endif
+endif
diff --git a/test cases/osx/4 framework/prog.c b/test cases/osx/4 framework/prog.c
new file mode 100644
index 0000000..9b6bdc2
--- /dev/null
+++ b/test cases/osx/4 framework/prog.c
@@ -0,0 +1,3 @@
+int main(void) {
+ return 0;
+}
diff --git a/test cases/osx/4 framework/stat.c b/test cases/osx/4 framework/stat.c
new file mode 100644
index 0000000..4825cef
--- /dev/null
+++ b/test cases/osx/4 framework/stat.c
@@ -0,0 +1 @@
+int func(void) { return 933; }
diff --git a/test cases/osx/4 framework/test.json b/test cases/osx/4 framework/test.json
new file mode 100644
index 0000000..8def69a
--- /dev/null
+++ b/test cases/osx/4 framework/test.json
@@ -0,0 +1,6 @@
+{
+ "installed": [
+ {"type": "file", "file": "usr/bin/prog"},
+ {"type": "file", "file": "usr/lib/libstat.a"}
+ ]
+}
diff --git a/test cases/osx/4 framework/xcode-frameworks.png b/test cases/osx/4 framework/xcode-frameworks.png
new file mode 100644
index 0000000..673d05a
--- /dev/null
+++ b/test cases/osx/4 framework/xcode-frameworks.png
Binary files differ