From 45cb405702d750d31ab2b68c379241a60257ea2c Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 5 Apr 2020 14:53:00 +0800 Subject: add bundle/framework template for objc++ --- .../templates/objc++/bundle/project/src/Info.plist | 24 ++++++++++++++++++++++ xmake/templates/objc++/bundle/project/src/test.h | 3 +++ xmake/templates/objc++/bundle/project/src/test.mm | 6 ++++++ xmake/templates/objc++/bundle/project/xmake.lua | 10 +++++++++ xmake/templates/objc++/bundle/template.lua | 2 ++ .../objc++/framework/project/src/Info.plist | 24 ++++++++++++++++++++++ .../templates/objc++/framework/project/src/test.h | 3 +++ .../templates/objc++/framework/project/src/test.mm | 6 ++++++ xmake/templates/objc++/framework/project/xmake.lua | 10 +++++++++ xmake/templates/objc++/framework/template.lua | 2 ++ 10 files changed, 90 insertions(+) create mode 100644 xmake/templates/objc++/bundle/project/src/Info.plist create mode 100644 xmake/templates/objc++/bundle/project/src/test.h create mode 100644 xmake/templates/objc++/bundle/project/src/test.mm create mode 100644 xmake/templates/objc++/bundle/project/xmake.lua create mode 100644 xmake/templates/objc++/bundle/template.lua create mode 100644 xmake/templates/objc++/framework/project/src/Info.plist create mode 100644 xmake/templates/objc++/framework/project/src/test.h create mode 100644 xmake/templates/objc++/framework/project/src/test.mm create mode 100644 xmake/templates/objc++/framework/project/xmake.lua create mode 100644 xmake/templates/objc++/framework/template.lua diff --git a/xmake/templates/objc++/bundle/project/src/Info.plist b/xmake/templates/objc++/bundle/project/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc++/bundle/project/src/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + diff --git a/xmake/templates/objc++/bundle/project/src/test.h b/xmake/templates/objc++/bundle/project/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc++/bundle/project/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc++/bundle/project/src/test.mm b/xmake/templates/objc++/bundle/project/src/test.mm new file mode 100644 index 000000000..84422f6a7 --- /dev/null +++ b/xmake/templates/objc++/bundle/project/src/test.mm @@ -0,0 +1,6 @@ +#include "test.h" + +int add(int a, int b) +{ + return a + b; +} diff --git a/xmake/templates/objc++/bundle/project/xmake.lua b/xmake/templates/objc++/bundle/project/xmake.lua new file mode 100644 index 000000000..484f4088e --- /dev/null +++ b/xmake/templates/objc++/bundle/project/xmake.lua @@ -0,0 +1,10 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + add_rules("xcode.bundle") + add_files("src/*.mm") + add_headerfiles("src/*.h") + add_installfiles("src/Info.plist") + --set_values("xcode.codesign_identity", "Apple Development: xxx@gmail.com (T3NA4MRVPU)") + +${FAQ} diff --git a/xmake/templates/objc++/bundle/template.lua b/xmake/templates/objc++/bundle/template.lua new file mode 100644 index 000000000..ce0949169 --- /dev/null +++ b/xmake/templates/objc++/bundle/template.lua @@ -0,0 +1,2 @@ +template("bundle") + add_configfiles("xmake.lua") diff --git a/xmake/templates/objc++/framework/project/src/Info.plist b/xmake/templates/objc++/framework/project/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc++/framework/project/src/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + diff --git a/xmake/templates/objc++/framework/project/src/test.h b/xmake/templates/objc++/framework/project/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc++/framework/project/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc++/framework/project/src/test.mm b/xmake/templates/objc++/framework/project/src/test.mm new file mode 100644 index 000000000..84422f6a7 --- /dev/null +++ b/xmake/templates/objc++/framework/project/src/test.mm @@ -0,0 +1,6 @@ +#include "test.h" + +int add(int a, int b) +{ + return a + b; +} diff --git a/xmake/templates/objc++/framework/project/xmake.lua b/xmake/templates/objc++/framework/project/xmake.lua new file mode 100644 index 000000000..e5d38722c --- /dev/null +++ b/xmake/templates/objc++/framework/project/xmake.lua @@ -0,0 +1,10 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + add_rules("xcode.framework") + add_files("src/*.mm") + add_headerfiles("src/*.h") + add_installfiles("src/Info.plist") + --set_values("xcode.codesign_identity", "Apple Development: xxx@gmail.com (T3NA4MRVPU)") + +${FAQ} diff --git a/xmake/templates/objc++/framework/template.lua b/xmake/templates/objc++/framework/template.lua new file mode 100644 index 000000000..aad04ec61 --- /dev/null +++ b/xmake/templates/objc++/framework/template.lua @@ -0,0 +1,2 @@ +template("framework") + add_configfiles("xmake.lua") -- cgit v1.3.1