summaryrefslogtreecommitdiff
path: root/tests/console_objc++
diff options
context:
space:
mode:
Diffstat (limited to 'tests/console_objc++')
-rwxr-xr-xtests/console_objc++/src/main.mm10
-rwxr-xr-xtests/console_objc++/xmake.lua43
2 files changed, 53 insertions, 0 deletions
diff --git a/tests/console_objc++/src/main.mm b/tests/console_objc++/src/main.mm
new file mode 100755
index 000000000..61a3f5875
--- /dev/null
+++ b/tests/console_objc++/src/main.mm
@@ -0,0 +1,10 @@
+#import <Foundation/Foundation.h>
+
+int main(int argc, char** argv)
+{
+ @autoreleasepool
+ {
+ NSLog(@"hello world!");
+ }
+ return 0;
+}
diff --git a/tests/console_objc++/xmake.lua b/tests/console_objc++/xmake.lua
new file mode 100755
index 000000000..ab706d51a
--- /dev/null
+++ b/tests/console_objc++/xmake.lua
@@ -0,0 +1,43 @@
+-- the debug mode
+if is_mode("debug") then
+
+ -- enable the debug symbols
+ set_symbols("debug")
+
+ -- disable optimization
+ set_optimize("none")
+end
+
+-- the release mode
+if is_mode("release") then
+
+ -- set the symbols visibility: hidden
+ set_symbols("hidden")
+
+ -- enable fastest optimization
+ set_optimize("fastest")
+
+ -- strip all symbols
+ set_strip("all")
+end
+
+-- for macosx or ios
+if os("macosx", "ios") then
+
+ -- add framework
+ add_mxflags("-framework Foundation", "-framework CoreFoundation")
+ add_ldflags("-framework Foundation", "-framework CoreFoundation")
+
+ -- enable arc?
+ add_mxflags("-fobjc-arc")
+end
+
+-- add target
+target("objcpp_console")
+
+ -- set kind
+ set_kind("binary")
+
+ -- add files
+ add_files("src/*.mm")
+