Fixed unity builds for Qt5.

pull/15/head
Jussi Pakkanen 11 years ago
parent 4c02a35fe0
commit c21637a01d
  1. 3
      backends.py
  2. 4
      run_tests.py
  3. 5
      test cases/frameworks/4 qt5/mainWindow.h
  4. 2
      test cases/frameworks/4 qt5/meson.build
  5. 1
      test cases/frameworks/4 qt5/stuff.qrc
  6. 5
      test cases/frameworks/4 qt5/stuff2.qrc

@ -218,7 +218,8 @@ class Backend():
for src in gen_src_deps: for src in gen_src_deps:
src_list.append(src) src_list.append(src)
if is_unity: if is_unity:
unity_src.append(src) unity_src.append(os.path.join(self.environment.get_build_dir(), src))
header_deps.append(src)
else: else:
# Generated targets are ordered deps because the must exist # Generated targets are ordered deps because the must exist
# before the sources compiling them are used. After the first # before the sources compiling them are used. After the first

@ -25,6 +25,7 @@ test_build_dir = 'work area'
install_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'install dir') install_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'install dir')
meson_command = './meson.py' meson_command = './meson.py'
unity_flags = ['--unity']
msbuild_exe = shutil.which('msbuild') msbuild_exe = shutil.which('msbuild')
if msbuild_exe is not None: if msbuild_exe is not None:
@ -107,7 +108,8 @@ def run_test(testdir, should_succeed):
os.mkdir(test_build_dir) os.mkdir(test_build_dir)
os.mkdir(install_dir) os.mkdir(install_dir)
print('Running test: ' + testdir) print('Running test: ' + testdir)
gen_command = [sys.executable, meson_command, '--prefix', install_dir, testdir, test_build_dir] + backend_flags gen_command = [sys.executable, meson_command, '--prefix', install_dir, testdir, test_build_dir]\
+ unity_flags + backend_flags
p = subprocess.Popen(gen_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) p = subprocess.Popen(gen_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(stdo, stde) = p.communicate() (stdo, stde) = p.communicate()
stdo = stdo.decode('utf-8') stdo = stdo.decode('utf-8')

@ -1,3 +1,6 @@
#ifndef MES_MAINWINDOW
#define MES_MAINWINDOW
#include <QObject> #include <QObject>
#include <QMainWindow> #include <QMainWindow>
#include "ui_mainWindow.h" #include "ui_mainWindow.h"
@ -13,3 +16,5 @@ public:
private: private:
}; };
#endif

@ -6,7 +6,7 @@ q5exe = executable('qt5app',
sources : ['main.cpp', 'mainWindow.cpp'], # Sources that don't need preprocessing. sources : ['main.cpp', 'mainWindow.cpp'], # Sources that don't need preprocessing.
moc_headers : ['mainWindow.h'], # These need to be fed through the moc tool before use. 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. ui_files : 'mainWindow.ui', # XML files that need to be compiled with the uic tol.
qresources : ['stuff.qrc', 'stuff2.qrc'], # Resource files for rcc compiler. qresources : 'stuff.qrc', # Resource file for rcc compiler.
deps : qt5dep) deps : qt5dep)
# We need a console test application because some test environments # We need a console test application because some test environments

@ -1,5 +1,6 @@
<!DOCTYPE RCC><RCC version="1.0"> <!DOCTYPE RCC><RCC version="1.0">
<qresource> <qresource>
<file>thing.png</file> <file>thing.png</file>
<file>thing2.png</file>
</qresource> </qresource>
</RCC> </RCC>

@ -1,5 +0,0 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>thing2.png</file>
</qresource>
</RCC>
Loading…
Cancel
Save