diff options
author | Markus Theil <markus.theil@tu-ilmenau.de> | 2017-11-09 18:15:42 +0100 |
---|---|---|
committer | Markus Theil <markus.theil@tu-ilmenau.de> | 2017-11-09 18:15:42 +0100 |
commit | 875b3bbbe46bc9a04f95e305e22380dc8a60af39 (patch) | |
tree | 0dfa775d64de64eb0c9b7d3941cff617c2514260 | |
parent | 91c07aa301b90de80612c29b4980cc3a612698f6 (diff) | |
download | meson-875b3bbbe46bc9a04f95e305e22380dc8a60af39.zip meson-875b3bbbe46bc9a04f95e305e22380dc8a60af39.tar.gz meson-875b3bbbe46bc9a04f95e305e22380dc8a60af39.tar.bz2 |
tests: fix qt unity build
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
-rw-r--r-- | test cases/frameworks/4 qt/main.cpp | 2 | ||||
-rw-r--r-- | test cases/frameworks/4 qt/meson.build | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/test cases/frameworks/4 qt/main.cpp b/test cases/frameworks/4 qt/main.cpp index cebe455..388467e 100644 --- a/test cases/frameworks/4 qt/main.cpp +++ b/test cases/frameworks/4 qt/main.cpp @@ -2,8 +2,10 @@ #include "mainWindow.h" int main(int argc, char **argv) { + #ifndef UNITY_BUILD Q_INIT_RESOURCE(stuff); Q_INIT_RESOURCE(stuff2); + #endif QApplication app(argc, argv); MainWindow *win = new MainWindow(); QImage qi(":/thing.png"); diff --git a/test cases/frameworks/4 qt/meson.build b/test cases/frameworks/4 qt/meson.build index f2ac94e..374707a 100644 --- a/test cases/frameworks/4 qt/meson.build +++ b/test cases/frameworks/4 qt/meson.build @@ -35,17 +35,26 @@ foreach qt : ['qt4', 'qt5'] prep = qtmodule.preprocess( moc_headers : ['mainWindow.h'], # These need to be fed through the moc tool before use. ui_files : 'mainWindow.ui', # XML files that need to be compiled with the uic tol. - qresources : ['stuff.qrc', 'stuff2.qrc'], # Resource file for rcc compiler. method : get_option('method') ) + # Resource file(s) for rcc compiler + extra_cpp_args = [] + if meson.is_unity() + extra_cpp_args += '-DUNITY_BUILD' + prep_rcc = qtmodule.preprocess(qt + '_unity_ressource', qresources : ['stuff.qrc', 'stuff2.qrc'], method : get_option('method')) + else + prep_rcc = qtmodule.preprocess(qresources : ['stuff.qrc', 'stuff2.qrc'], method : get_option('method')) + endif + # Test that setting a unique name with a positional argument works qtmodule.preprocess(qt + 'teststuff', qresources : ['stuff.qrc', 'stuff2.qrc'], method : get_option('method')) qexe = executable(qt + 'app', sources : ['main.cpp', 'mainWindow.cpp', # Sources that don't need preprocessing. - prep], - dependencies : qtdep) + prep, prep_rcc], + dependencies : qtdep, + cpp_args: extra_cpp_args) # We need a console test application because some test environments # do not have an X server. |