diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-04-23 14:04:14 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-04-24 07:40:13 +0000 |
commit | 3653385af94ae7fe042d1c4845293b495bdc9854 (patch) | |
tree | 8eab19463079bdd049133dd1ccb6e5ad1a4a22d9 /tests/auto/blackbox/testdata-qt | |
parent | 5a244da9d3d1089703c4501e7ea745f424fbcf15 (diff) |
Qt templates: Make moc rule handle C++ amalgamation correctly
In C++ amalgamation mode, the source files need to be moc'ed before
merging, because otherwise including .moc files will not work.
Task-number: QBS-1252
Change-Id: I6e4bef4b46ec7bc3cf7ce7a950b380d469cc0afd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata-qt')
4 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/main.cpp b/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/main.cpp new file mode 100644 index 000000000..b586f8a8d --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/main.cpp @@ -0,0 +1,6 @@ +#include "myobject.h" + +int main() +{ + useMyObject(); +} diff --git a/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/moc-and-cxx-combining.qbs b/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/moc-and-cxx-combining.qbs new file mode 100644 index 000000000..1b0b9f54a --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/moc-and-cxx-combining.qbs @@ -0,0 +1,6 @@ +import qbs + +QtApplication { + cpp.combineCxxSources: true + files: ["main.cpp", "myobject.h", "myobject.cpp"] +} diff --git a/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/myobject.cpp b/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/myobject.cpp new file mode 100644 index 000000000..7e2e3ac08 --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/myobject.cpp @@ -0,0 +1,14 @@ +#include "myobject.h" + +#include <QObject> + +class MyObject : public QObject +{ + Q_OBJECT +public: + void use() {} +}; + +void useMyObject() { MyObject().use(); } + +#include <myobject.moc> diff --git a/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/myobject.h b/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/myobject.h new file mode 100644 index 000000000..013d3ee9c --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/myobject.h @@ -0,0 +1,6 @@ +#ifndef MYOBJECT_H +#define MYOBJECT_H + +void useMyObject(); + +#endif |