diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2020-06-25 11:32:12 -0400 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-07-13 22:28:58 +0000 |
commit | f2dad788e782a9e7b5abb8a036370f6d8e29f7fc (patch) | |
tree | 85488942f5ceda014f534b742beb3325eed0751e /mesonbuild | |
parent | 848fcb6a537d58cf5d49ac9d3d10b4444bb420ad (diff) | |
download | meson-f2dad788e782a9e7b5abb8a036370f6d8e29f7fc.zip meson-f2dad788e782a9e7b5abb8a036370f6d8e29f7fc.tar.gz meson-f2dad788e782a9e7b5abb8a036370f6d8e29f7fc.tar.bz2 |
qt module: rcc supports depfiles now, given a recent enough version of Qt5
Add depfile support to generated targets for Qt >= 5.14.
Move warning into the module init itself, to check if the version is too
old before issuing. Also tweak the wording itself, to advise upgrading
to a suitable version of Qt5 instead of advising to wait for a Qt bug to
be fixed.
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/modules/qt.py | 11 | ||||
-rw-r--r-- | mesonbuild/modules/qt4.py | 3 | ||||
-rw-r--r-- | mesonbuild/modules/qt5.py | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py index c2b1e01..c810df6 100644 --- a/mesonbuild/modules/qt.py +++ b/mesonbuild/modules/qt.py @@ -15,7 +15,7 @@ import os from .. import mlog from .. import build -from ..mesonlib import MesonException, extract_as_list, File, unholder +from ..mesonlib import MesonException, extract_as_list, File, unholder, version_compare from ..dependencies import Dependency, Qt4Dependency, Qt5Dependency, NonExistingExternalProgram import xml.etree.ElementTree as ET from . import ModuleReturnValue, get_include_args, ExtensionModule @@ -30,6 +30,7 @@ _QT_DEPS_LUT = { class QtBaseModule(ExtensionModule): tools_detected = False + rcc_supports_depfiles = False def __init__(self, interpreter, qt_version=5): ExtensionModule.__init__(self, interpreter) @@ -46,6 +47,11 @@ class QtBaseModule(ExtensionModule): if qt.found(): # Get all tools and then make sure that they are the right version self.moc, self.uic, self.rcc, self.lrelease = qt.compilers_detect(self.interpreter) + if version_compare(qt.version, '>=5.14.0'): + self.rcc_supports_depfiles = True + else: + mlog.warning('rcc dependencies will not work properly until you move to Qt >= 5.14:', + mlog.bold('https://bugreports.qt.io/browse/QTBUG-45460'), fatal=False) else: suffix = '-qt{}'.format(self.qt_version) self.moc = NonExistingExternalProgram(name='moc' + suffix) @@ -156,6 +162,9 @@ class QtBaseModule(ExtensionModule): 'output': name + '.cpp', 'command': [self.rcc, '-name', '@BASENAME@', '-o', '@OUTPUT@', rcc_extra_arguments, '@INPUT@'], 'depend_files': qrc_deps} + if self.rcc_supports_depfiles: + rcc_kwargs['depfile'] = name + '.d' + rcc_kwargs['command'] += ['--depfile', '@DEPFILE@'] res_target = build.CustomTarget(name, state.subdir, state.subproject, rcc_kwargs) sources.append(res_target) if ui_files: diff --git a/mesonbuild/modules/qt4.py b/mesonbuild/modules/qt4.py index 81a1055..e85a150 100644 --- a/mesonbuild/modules/qt4.py +++ b/mesonbuild/modules/qt4.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .. import mlog from .qt import QtBaseModule @@ -23,6 +22,4 @@ class Qt4Module(QtBaseModule): def initialize(*args, **kwargs): - mlog.warning('rcc dependencies will not work properly until this upstream issue is fixed:', - mlog.bold('https://bugreports.qt.io/browse/QTBUG-45460'), fatal=False) return Qt4Module(*args, **kwargs) diff --git a/mesonbuild/modules/qt5.py b/mesonbuild/modules/qt5.py index 244a217..873c2db 100644 --- a/mesonbuild/modules/qt5.py +++ b/mesonbuild/modules/qt5.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .. import mlog from .qt import QtBaseModule @@ -23,6 +22,4 @@ class Qt5Module(QtBaseModule): def initialize(*args, **kwargs): - mlog.warning('rcc dependencies will not work reliably until this upstream issue is fixed:', - mlog.bold('https://bugreports.qt.io/browse/QTBUG-45460'), fatal=False) return Qt5Module(*args, **kwargs) |