tests: fix qt unity build

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
pull/2579/head
Markus Theil 7 years ago
parent 91c07aa301
commit 875b3bbbe4
  1. 2
      test cases/frameworks/4 qt/main.cpp
  2. 15
      test cases/frameworks/4 qt/meson.build

@ -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");

@ -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.

Loading…
Cancel
Save