diff options
Diffstat (limited to 'tests/projects/objc++/modulemap')
| -rw-r--r-- | tests/projects/objc++/modulemap/src/hello.h | 7 | ||||
| -rw-r--r-- | tests/projects/objc++/modulemap/src/hello.m | 10 | ||||
| -rw-r--r-- | tests/projects/objc++/modulemap/src/main.mm | 8 | ||||
| -rw-r--r-- | tests/projects/objc++/modulemap/src/module.modulemap | 4 | ||||
| -rw-r--r-- | tests/projects/objc++/modulemap/xmake.lua | 6 |
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") + + |
