aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/qtprofilesetup/templates/core.qbs
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-02-10 18:08:01 +0100
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-02-13 15:33:27 +0100
commite73f60919079fc7cb0f0ad6d50b1a364c7b0d2a6 (patch)
tree3ce15f1f9b336063d591999ce325ce28a6e21320 /src/lib/qtprofilesetup/templates/core.qbs
parenta3634a6bbb193c47cdec887a6b29356c979961aa (diff)
support transformers with an unknown number of outputs
To support different types of nodes in the build graph, we introduce the base class BuildGraphNode. Artifact now derives from BuildGraphNode. A RuleNode class is introduced that represents a rule in the build graph. Rules are applied in the build phase and not in a pre-build phase anymore. The handling of moc has been revisited. The fixed automoc pre-build phase is no more. This is the squashed merge of a feature branch. Task-number: QBS-370 Change-Id: If27cdc51cba8c9542e4282c2caa456faa723aeff Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src/lib/qtprofilesetup/templates/core.qbs')
-rw-r--r--src/lib/qtprofilesetup/templates/core.qbs64
1 files changed, 21 insertions, 43 deletions
diff --git a/src/lib/qtprofilesetup/templates/core.qbs b/src/lib/qtprofilesetup/templates/core.qbs
index 2b052d3d1..3199e0db5 100644
--- a/src/lib/qtprofilesetup/templates/core.qbs
+++ b/src/lib/qtprofilesetup/templates/core.qbs
@@ -203,50 +203,28 @@ Module {
}
Rule {
- inputs: ["moc_cpp"]
-
- Artifact {
- fileName: ModUtils.moduleProperty(product, "generatedFilesDir")
- + '/' + input.completeBaseName + ".moc"
- fileTags: ["hpp"]
- }
-
- prepare: {
- var cmd = new Command(Moc.fullPath(product),
- Moc.args(product, input, output.fileName));
- cmd.description = 'moc ' + FileInfo.fileName(input.fileName);
- cmd.highlight = 'codegen';
- return cmd;
- }
- }
-
- Rule {
- inputs: ["moc_hpp"]
-
- Artifact {
- fileName: ModUtils.moduleProperty(product, "generatedFilesDir")
- + "/moc_" + input.completeBaseName + ".cpp"
- fileTags: [ "cpp" ]
- }
-
- prepare: {
- var cmd = new Command(Moc.fullPath(product),
- Moc.args(product, input, output.fileName));
- cmd.description = 'moc ' + FileInfo.fileName(input.fileName);
- cmd.highlight = 'codegen';
- return cmd;
- }
- }
-
- Rule {
- inputs: ["moc_hpp_inc"]
-
- Artifact {
- fileName: ModUtils.moduleProperty(product, "generatedFilesDir")
- + "/moc_" + input.completeBaseName + ".cpp"
- fileTags: [ "hpp" ]
+ name: "QtCoreMocRule"
+ inputs: ["cpp", "hpp"]
+ auxiliaryInputs: ["qt_plugin_metadata"]
+ excludedAuxiliaryInputs: ["unmocable"]
+ outputFileTags: ["hpp", "cpp", "unmocable"]
+ outputArtifacts: {
+ var mocinfo = QtMocScanner.apply(input);
+ if (!mocinfo.hasQObjectMacro)
+ return [];
+ var artifact = { fileTags: ["unmocable"] };
+ if (input.fileTags.contains("hpp")) {
+ artifact.filePath = ModUtils.moduleProperty(product, "generatedFilesDir")
+ + "/moc_" + input.completeBaseName + ".cpp";
+ } else {
+ artifact.filePath = ModUtils.moduleProperty(product, "generatedFilesDir")
+ + '/' + input.completeBaseName + ".moc";
+ }
+ artifact.fileTags.push(mocinfo.mustCompile ? "cpp" : "hpp");
+ if (mocinfo.hasPluginMetaDataMacro)
+ artifact.explicitlyDependsOn = ["qt_plugin_metadata"];
+ return [artifact];
}
-
prepare: {
var cmd = new Command(Moc.fullPath(product),
Moc.args(product, input, output.fileName));