summaryrefslogtreecommitdiff
path: root/tests/projects/objc++
diff options
context:
space:
mode:
authorruki <[email protected]>2019-09-07 00:49:30 +0800
committerruki <[email protected]>2019-09-06 22:57:05 +0800
commit1d6857de2bc044f45f76270256fad011a591abfc (patch)
tree2a028539f470eaee636744990e15c3c42b39edbd /tests/projects/objc++
parent0f7e7701f27eec0118930eddefba0d0ca3269d38 (diff)
add modulemap tests
Diffstat (limited to 'tests/projects/objc++')
-rw-r--r--tests/projects/objc++/modulemap/src/hello.h7
-rw-r--r--tests/projects/objc++/modulemap/src/hello.m10
-rw-r--r--tests/projects/objc++/modulemap/src/main.mm8
-rw-r--r--tests/projects/objc++/modulemap/src/module.modulemap4
-rw-r--r--tests/projects/objc++/modulemap/xmake.lua6
5 files changed, 35 insertions, 0 deletions
diff --git a/tests/projects/objc++/modulemap/src/hello.h b/tests/projects/objc++/modulemap/src/hello.h
new file mode 100644
index 000000000..7eb60b9e6
--- /dev/null
+++ b/tests/projects/objc++/modulemap/src/hello.h
@@ -0,0 +1,7 @@
+#import <Foundation/Foundation.h>
+
+@interface Hello : NSObject
+
++ (void)say:(NSString*)s;
+
+@end
diff --git a/tests/projects/objc++/modulemap/src/hello.m b/tests/projects/objc++/modulemap/src/hello.m
new file mode 100644
index 000000000..b22f844f2
--- /dev/null
+++ b/tests/projects/objc++/modulemap/src/hello.m
@@ -0,0 +1,10 @@
+#import "hello.h"
+
+@implementation Hello
+
++ (void)say:(NSString*)s
+{
+ NSLog(@"%@\n", s);
+}
+
+@end
diff --git a/tests/projects/objc++/modulemap/src/main.mm b/tests/projects/objc++/modulemap/src/main.mm
new file mode 100644
index 000000000..5f6fd74cb
--- /dev/null
+++ b/tests/projects/objc++/modulemap/src/main.mm
@@ -0,0 +1,8 @@
+#import <Foundation/Foundation.h>
+@import Hello;
+
+int main(int argc, char** argv)
+{
+ [Hello say:@"hello"];
+ return 0;
+}
diff --git a/tests/projects/objc++/modulemap/src/module.modulemap b/tests/projects/objc++/modulemap/src/module.modulemap
new file mode 100644
index 000000000..91a9c4235
--- /dev/null
+++ b/tests/projects/objc++/modulemap/src/module.modulemap
@@ -0,0 +1,4 @@
+module Hello {
+ header "hello.h"
+ export *
+}
diff --git a/tests/projects/objc++/modulemap/xmake.lua b/tests/projects/objc++/modulemap/xmake.lua
new file mode 100644
index 000000000..a7cdbc308
--- /dev/null
+++ b/tests/projects/objc++/modulemap/xmake.lua
@@ -0,0 +1,6 @@
+target("modulemap")
+ set_kind("binary")
+ add_files("src/*.mm", "src/*.m")
+ add_mxxflags("-fmodules", "-fcxx-modules", "-fmodule-map-file=src/module.modulemap")
+
+