aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/cpp/mac-gcc.qbs
diff options
context:
space:
mode:
Diffstat (limited to 'share/qbs/modules/cpp/mac-gcc.qbs')
-rw-r--r--share/qbs/modules/cpp/mac-gcc.qbs69
1 files changed, 69 insertions, 0 deletions
diff --git a/share/qbs/modules/cpp/mac-gcc.qbs b/share/qbs/modules/cpp/mac-gcc.qbs
new file mode 100644
index 000000000..fda5da3f2
--- /dev/null
+++ b/share/qbs/modules/cpp/mac-gcc.qbs
@@ -0,0 +1,69 @@
+import qbs.base 1.0
+
+GenericGCC {
+ condition: qbs.hostOS == 'mac' && qbs.targetOS == 'mac' && qbs.toolchain == 'gcc'
+
+ Rule {
+ multiplex: true
+ inputs: ["qbs"]
+
+ Artifact {
+ fileName: product.name + ".app/Info.plist"
+ fileTags: ["infoplist"]
+ }
+
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = "generating Info.plist";
+ cmd.highlight = "codegen";
+ cmd.sourceCode = function() {
+ var infoplist = new TextFile(outputs.infoplist[0].fileName, TextFile.WriteOnly);
+ infoplist.write("<foobar>");
+ infoplist.close();
+ }
+ return cmd;
+ }
+ }
+
+ Rule {
+ multiplex: true
+ inputs: ["qbs"]
+
+ Artifact {
+ fileName: product.name + ".app/PkgInfo"
+ fileTags: ["pkginfo"]
+ }
+
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = "generating PkgInfo";
+ cmd.highlight = "codegen";
+ cmd.sourceCode = function() {
+ var pkginfo = new TextFile(outputs.pkginfo[0].fileName, TextFile.WriteOnly);
+ pkginfo.write("FOO");
+ pkginfo.close();
+ }
+ return cmd;
+ }
+ }
+
+ Rule {
+ multiplex: true
+ inputs: ["application", "infoplist", "pkginfo"]
+
+ Artifact {
+ fileName: product.name + ".app/Contents/MacOS/" + product.name
+ fileTags: ["applicationbundle"]
+ }
+
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = "generating app bundle";
+ cmd.highlight = "codegen";
+ cmd.sourceCode = function() {
+ File.copy(inputs.application[0].fileName, outputs.applicationbundle[0].fileName);
+ }
+ return cmd;
+ }
+ }
+}