aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphaël Cotty <raphael.cotty@gmail.com>2020-11-22 00:08:34 +0100
committerRaphaël Cotty <raphael.cotty@gmail.com>2020-11-26 15:50:09 +0000
commit578b6d6978d7b42baefd85277c0d332f36142c65 (patch)
tree4ae8bc30ad52a38271caf5b41586278caf327f9e
parentf89169ccb8651613e5c97bd7db62a0d10e969e97 (diff)
Disable moc for the aggregate product when multiplexing
Running moc in the aggregate can't happen anymore because it generates an error when accessing cpp.defines. Before 527d5a8ec54e44291d4968754bdf574ebe57822b cpp.defines was not accessed for hpp files. Anyway it doesn't make sense to call moc in the aggregate as the generated files won't be compiled. Change-Id: I25ada3c8c54b199efb0877b59025fff88dc84dd8 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r--share/qbs/module-providers/Qt/templates/core.qbs5
-rw-r--r--tests/auto/blackbox/testdata-android/qt-app/MainWindow.cpp11
-rw-r--r--tests/auto/blackbox/testdata-android/qt-app/MainWindow.h15
-rw-r--r--tests/auto/blackbox/testdata-android/qt-app/main.cpp7
-rw-r--r--tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs2
5 files changed, 36 insertions, 4 deletions
diff --git a/share/qbs/module-providers/Qt/templates/core.qbs b/share/qbs/module-providers/Qt/templates/core.qbs
index 113f868cf..691e4b50c 100644
--- a/share/qbs/module-providers/Qt/templates/core.qbs
+++ b/share/qbs/module-providers/Qt/templates/core.qbs
@@ -292,9 +292,13 @@ Module {
property bool combineMocOutput: cpp.combineCxxSources
property bool enableBigResources: false
+ // Product should not moc in the aggregate when multiplexing.
+ property bool enableMoc: !(product.multiplexed || product.aggregate)
+ || product.multiplexConfigurationId
Rule {
name: "QtCoreMocRuleCpp"
+ condition: enableMoc
property string cppInput: cpp.combineCxxSources ? "cpp.combine" : "cpp"
property string objcppInput: cpp.combineObjcxxSources ? "objcpp.combine" : "objcpp"
inputs: [objcppInput, cppInput]
@@ -306,6 +310,7 @@ Module {
}
Rule {
name: "QtCoreMocRuleHpp"
+ condition: enableMoc
inputs: "hpp"
auxiliaryInputs: ["qt_plugin_metadata", "cpp", "objcpp"];
excludedInputs: "unmocable"
diff --git a/tests/auto/blackbox/testdata-android/qt-app/MainWindow.cpp b/tests/auto/blackbox/testdata-android/qt-app/MainWindow.cpp
new file mode 100644
index 000000000..b2e08c83e
--- /dev/null
+++ b/tests/auto/blackbox/testdata-android/qt-app/MainWindow.cpp
@@ -0,0 +1,11 @@
+#include "MainWindow.h"
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
+{
+}
+
+MainWindow::~MainWindow()
+{
+}
+
diff --git a/tests/auto/blackbox/testdata-android/qt-app/MainWindow.h b/tests/auto/blackbox/testdata-android/qt-app/MainWindow.h
new file mode 100644
index 000000000..ace53a4a0
--- /dev/null
+++ b/tests/auto/blackbox/testdata-android/qt-app/MainWindow.h
@@ -0,0 +1,15 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = nullptr);
+ ~MainWindow();
+};
+
+#endif // MAINWINDOW_H
diff --git a/tests/auto/blackbox/testdata-android/qt-app/main.cpp b/tests/auto/blackbox/testdata-android/qt-app/main.cpp
index 6278e2924..0a0916fca 100644
--- a/tests/auto/blackbox/testdata-android/qt-app/main.cpp
+++ b/tests/auto/blackbox/testdata-android/qt-app/main.cpp
@@ -1,10 +1,11 @@
-#include <QMainWindow>
+#include "MainWindow.h"
+
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
- QMainWindow w;
+ MainWindow w;
w.show();
- return 0;
+ return a.exec();
}
diff --git a/tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs b/tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs
index ceeda2dc3..981c9eb3d 100644
--- a/tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs
+++ b/tests/auto/blackbox/testdata-android/qt-app/qt-app.qbs
@@ -1,7 +1,7 @@
Project {
QtGuiApplication {
Depends { name: "Lib" }
- files: "main.cpp"
+ files: ["main.cpp", "MainWindow.cpp", "MainWindow.h"]
Android.sdk.packageName: "my.qtapp"
Android.sdk.apkBaseName: name
Depends { name: "Qt"; submodules: ["core", "widgets"] }