diff options
-rw-r--r-- | mesonbuild/modules/qt5.py | 14 | ||||
-rw-r--r-- | test cases/frameworks/4 qt5/meson.build | 9 | ||||
-rw-r--r-- | test cases/frameworks/4 qt5/stuff.qrc | 1 | ||||
-rw-r--r-- | test cases/frameworks/4 qt5/stuff2.qrc | 6 |
4 files changed, 21 insertions, 9 deletions
diff --git a/mesonbuild/modules/qt5.py b/mesonbuild/modules/qt5.py index f669d77..e12d5ea 100644 --- a/mesonbuild/modules/qt5.py +++ b/mesonbuild/modules/qt5.py @@ -125,14 +125,18 @@ class Qt5Module(): if len(rcc_files) > 0: rcc_kwargs = {'output' : '@BASENAME@.cpp', 'arguments' : ['@INPUT@', '-o', '@OUTPUT@']} - rcc_gen = build.Generator([self.rcc], rcc_kwargs) - rcc_output = build.GeneratedList(rcc_gen) qrc_deps = [] for i in rcc_files: qrc_deps += self.parse_qrc(state, i) - rcc_output.extra_depends = qrc_deps - [rcc_output.add_file(os.path.join(state.subdir, a)) for a in rcc_files] - sources.append(rcc_output) + rcc_kwargs = {'input' : rcc_files, + 'output' : rcc_files[0] + '.cpp', + 'command' : [self.rcc, '-o', '@OUTPUT@', '@INPUT@'], + 'depend_files' : qrc_deps, + } + res_target = build.CustomTarget(rcc_files[0].replace('.', '_'), + state.subdir, + rcc_kwargs) + sources.append(res_target) if len(ui_files) > 0: ui_kwargs = {'output' : 'ui_@BASENAME@.h', 'arguments' : ['-o', '@OUTPUT@', '@INPUT@']} diff --git a/test cases/frameworks/4 qt5/meson.build b/test cases/frameworks/4 qt5/meson.build index cfea5ba..5672071 100644 --- a/test cases/frameworks/4 qt5/meson.build +++ b/test cases/frameworks/4 qt5/meson.build @@ -3,10 +3,13 @@ project('qt5 build test', 'cpp') qt5 = import('qt5') qt5dep = dependency('qt5', modules : ['Core', 'Gui', 'Widgets']) +# The following has two resource files because having two in one target +# requires you to do it properly or you get linker symbol clashes. + prep = qt5.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', # Resource file for rcc compiler. + 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. ) q5exe = executable('qt5app', diff --git a/test cases/frameworks/4 qt5/stuff.qrc b/test cases/frameworks/4 qt5/stuff.qrc index 9152500..fdfb58e 100644 --- a/test cases/frameworks/4 qt5/stuff.qrc +++ b/test cases/frameworks/4 qt5/stuff.qrc @@ -2,6 +2,5 @@ <RCC version="1.0"> <qresource> <file>thing.png</file> - <file>thing2.png</file> </qresource> </RCC> diff --git a/test cases/frameworks/4 qt5/stuff2.qrc b/test cases/frameworks/4 qt5/stuff2.qrc new file mode 100644 index 0000000..910e2fb --- /dev/null +++ b/test cases/frameworks/4 qt5/stuff2.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC> +<RCC version="1.0"> + <qresource> + <file>thing2.png</file> + </qresource> +</RCC> |