summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-08-26 15:42:52 (GMT)
committerBrad King <brad.king@kitware.com>2020-08-31 17:07:23 (GMT)
commit6b20bbd2dd78747cb951d32c12b63c9605971b32 (patch)
treed45c56f99071d70c0833239587ce0fa7c7c9a52e /Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp
parent9fbd3df21e4059f97a683922635b4b70c8465b3f (diff)
downloadCMake-6b20bbd2dd78747cb951d32c12b63c9605971b32.zip
CMake-6b20bbd2dd78747cb951d32c12b63c9605971b32.tar.gz
CMake-6b20bbd2dd78747cb951d32c12b63c9605971b32.tar.bz2
AutoMoc: Restore support for re-running after project file changes
For Qt >= 5.15.0 and Ninja generators AutoMoc creates a depfile to let Ninja decide when to run AutoMoc. This was introduced by commit aebfbcaa46 (AutoGen: Use depfiles for the XXX_autogen ninja targets, 2020-01-14, v3.17.0-rc1~58^2). However, AutoMoc was not triggered after adding a new moc-able file to the project. This patch adds the project file (and potentially included files) to the dependencies in the depfile. Now, a re-run of AutoMoc is triggered if the project file changes. Fixes: #21127
Diffstat (limited to 'Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp')
-rw-r--r--Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp
new file mode 100644
index 0000000..45c5af6
--- /dev/null
+++ b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp
@@ -0,0 +1,15 @@
+#include <qobject.h>
+
+class AnotherObject : public QObject
+{
+ Q_OBJECT
+public:
+ AnotherObject() {}
+};
+
+AnotherObject* createAnotherObject()
+{
+ return new AnotherObject();
+}
+
+#include "anotherobject.moc"