diff options
| author | ruki <[email protected]> | 2026-08-09 18:25:05 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-08-09 18:25:05 +0800 |
| commit | ced7f2ae519bc9eca92bcf4f177fe177ddd0e747 (patch) | |
| tree | af4d584b3c7badc1df56038cdb29099b4f3e99fd /xmake/templates/objc++ | |
| parent | 6ac4ea833193a4319a1eb6e5f588d1877fd48064 (diff) | |
| parent | 5f5daf64c504e1103a355f45bf925a5149b03e24 (diff) | |
Merge pull request #7699 from xmake-io/templates
move templates dir
Diffstat (limited to 'xmake/templates/objc++')
| -rw-r--r-- | xmake/templates/objc++/console/src/main.mm | 8 | ||||
| -rw-r--r-- | xmake/templates/objc++/console/xmake.lua | 13 | ||||
| -rw-r--r-- | xmake/templates/objc++/xcode/bundle/src/Info.plist | 24 | ||||
| -rw-r--r-- | xmake/templates/objc++/xcode/bundle/src/test.h | 3 | ||||
| -rw-r--r-- | xmake/templates/objc++/xcode/bundle/src/test.mm | 5 | ||||
| -rw-r--r-- | xmake/templates/objc++/xcode/bundle/xmake.lua | 9 | ||||
| -rw-r--r-- | xmake/templates/objc++/xcode/framework/src/Info.plist | 24 | ||||
| -rw-r--r-- | xmake/templates/objc++/xcode/framework/src/test.h | 3 | ||||
| -rw-r--r-- | xmake/templates/objc++/xcode/framework/src/test.mm | 5 | ||||
| -rw-r--r-- | xmake/templates/objc++/xcode/framework/xmake.lua | 9 |
10 files changed, 103 insertions, 0 deletions
diff --git a/xmake/templates/objc++/console/src/main.mm b/xmake/templates/objc++/console/src/main.mm new file mode 100644 index 000000000..cbd1e8906 --- /dev/null +++ b/xmake/templates/objc++/console/src/main.mm @@ -0,0 +1,8 @@ +#import <Foundation/Foundation.h> + +int main(int argc, char** argv) { + @autoreleasepool { + NSLog(@"hello world!"); + } + return 0; +} diff --git a/xmake/templates/objc++/console/xmake.lua b/xmake/templates/objc++/console/xmake.lua new file mode 100644 index 000000000..99749f901 --- /dev/null +++ b/xmake/templates/objc++/console/xmake.lua @@ -0,0 +1,13 @@ +-- add modes: debug and release +add_rules("mode.debug", "mode.release") + +-- add target +target("${TARGET_NAME}") + + -- set kind + set_kind("binary") + + -- add files + add_files("src/*.mm") + +${FAQ} diff --git a/xmake/templates/objc++/xcode/bundle/src/Info.plist b/xmake/templates/objc++/xcode/bundle/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc++/xcode/bundle/src/Info.plist @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>$(DEVELOPMENT_LANGUAGE)</string> + <key>CFBundleExecutable</key> + <string>$(EXECUTABLE_NAME)</string> + <key>CFBundleIdentifier</key> + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>$(PRODUCT_NAME)</string> + <key>CFBundlePackageType</key> + <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleVersion</key> + <string>$(CURRENT_PROJECT_VERSION)</string> + <key>NSHumanReadableCopyright</key> + <string>Copyright © 2020 tboox. All rights reserved.</string> +</dict> +</plist> diff --git a/xmake/templates/objc++/xcode/bundle/src/test.h b/xmake/templates/objc++/xcode/bundle/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc++/xcode/bundle/src/test.h @@ -0,0 +1,3 @@ +#import <Foundation/Foundation.h> + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc++/xcode/bundle/src/test.mm b/xmake/templates/objc++/xcode/bundle/src/test.mm new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/templates/objc++/xcode/bundle/src/test.mm @@ -0,0 +1,5 @@ +#include "test.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/templates/objc++/xcode/bundle/xmake.lua b/xmake/templates/objc++/xcode/bundle/xmake.lua new file mode 100644 index 000000000..1ecf69fcb --- /dev/null +++ b/xmake/templates/objc++/xcode/bundle/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("xcode.bundle") + add_files("src/*.mm") + add_files("src/Info.plist") + add_headerfiles("src/*.h") + +${FAQ} diff --git a/xmake/templates/objc++/xcode/framework/src/Info.plist b/xmake/templates/objc++/xcode/framework/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc++/xcode/framework/src/Info.plist @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>$(DEVELOPMENT_LANGUAGE)</string> + <key>CFBundleExecutable</key> + <string>$(EXECUTABLE_NAME)</string> + <key>CFBundleIdentifier</key> + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>$(PRODUCT_NAME)</string> + <key>CFBundlePackageType</key> + <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleVersion</key> + <string>$(CURRENT_PROJECT_VERSION)</string> + <key>NSHumanReadableCopyright</key> + <string>Copyright © 2020 tboox. All rights reserved.</string> +</dict> +</plist> diff --git a/xmake/templates/objc++/xcode/framework/src/test.h b/xmake/templates/objc++/xcode/framework/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc++/xcode/framework/src/test.h @@ -0,0 +1,3 @@ +#import <Foundation/Foundation.h> + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc++/xcode/framework/src/test.mm b/xmake/templates/objc++/xcode/framework/src/test.mm new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/templates/objc++/xcode/framework/src/test.mm @@ -0,0 +1,5 @@ +#include "test.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/templates/objc++/xcode/framework/xmake.lua b/xmake/templates/objc++/xcode/framework/xmake.lua new file mode 100644 index 000000000..3805d95c6 --- /dev/null +++ b/xmake/templates/objc++/xcode/framework/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("xcode.framework") + add_files("src/*.mm") + add_files("src/Info.plist") + add_headerfiles("src/*.h") + +${FAQ} |
