diff options
| author | ruki <[email protected]> | 2018-04-28 00:47:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-04-27 22:45:56 +0800 |
| commit | 119dd6ff5786ef7a390b98b0558554029113f0dd (patch) | |
| tree | 2fa5d1196a8951c0f8e4ad67c8b443b47280a0ab /tests/projects/objc++/console | |
| parent | 7d486e88c2b3301449974e0e97168bc0f0fd6c64 (diff) | |
add wdk tests
Diffstat (limited to 'tests/projects/objc++/console')
| -rw-r--r-- | tests/projects/objc++/console/src/main.mm | 10 | ||||
| -rw-r--r-- | tests/projects/objc++/console/test.lua | 11 | ||||
| -rw-r--r-- | tests/projects/objc++/console/xmake.lua | 42 |
3 files changed, 63 insertions, 0 deletions
diff --git a/tests/projects/objc++/console/src/main.mm b/tests/projects/objc++/console/src/main.mm new file mode 100644 index 000000000..61a3f5875 --- /dev/null +++ b/tests/projects/objc++/console/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/projects/objc++/console/test.lua b/tests/projects/objc++/console/test.lua new file mode 100644 index 000000000..be0449702 --- /dev/null +++ b/tests/projects/objc++/console/test.lua @@ -0,0 +1,11 @@ +-- imports +import("..build") + +-- main entry +function main() + + -- build project + if os.host() == "macosx" then + build({iphoneos = true}) + end +end diff --git a/tests/projects/objc++/console/xmake.lua b/tests/projects/objc++/console/xmake.lua new file mode 100644 index 000000000..a9229c7f3 --- /dev/null +++ b/tests/projects/objc++/console/xmake.lua @@ -0,0 +1,42 @@ +-- 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 + +-- add frameworks +add_frameworks("Foundation", "CoreFoundation") + +-- for macosx or ios +if is_os("macosx", "ios") then + + -- enable arc? + add_mxflags("-fobjc-arc") +end + +-- add target +target("console_objc++") + + -- set kind + set_kind("binary") + + -- add files + add_files("src/*.mm") + |
