aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Lindgren <john@jlindgren.net>2022-01-08 16:21:27 -0500
committerEli Schwartz <eschwartz93@gmail.com>2022-04-12 20:42:42 -0400
commita606ce22eb0dd05eef56384d59954edad7da131d (patch)
tree01a244ab52261814c9067c6baca538c66b8453a5
parent589600cb51534decf1ce2a10e4739dc1d4c26ae0 (diff)
downloadmeson-a606ce22eb0dd05eef56384d59954edad7da131d.zip
meson-a606ce22eb0dd05eef56384d59954edad7da131d.tar.gz
meson-a606ce22eb0dd05eef56384d59954edad7da131d.tar.bz2
Add support for Qt 6.1+
Qt 6.1 moved the location of some binaries from QT_HOST_BINS to QT_HOST_LIBEXECS as noted in the changelog: c515ee178f Move build tools to libexec instead of the bin dir - Tools that are called by the build system and are unlikely to be called by the user are now installed to the libexec directory. https://code.qt.io/cgit/qt/qtreleasenotes.git/tree/qt/6.1.0/release-note.txt It's possible to help the 'qt' module find the tools by adding Qt's libexec directory to the PATH environment variable, but this manual workaround is not ideal. To compensate, meson now needs to look for moc, rcc, uic, etc. in QT_HOST_LIBEXECS as well as QT_HOST_BINS. Co-authored-by: Stefan Hajnoczi <stefanha@jammr.net>
-rw-r--r--mesonbuild/dependencies/qt.py9
-rw-r--r--mesonbuild/modules/qt.py2
2 files changed, 11 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/qt.py b/mesonbuild/dependencies/qt.py
index f645f0e..d2be1a4 100644
--- a/mesonbuild/dependencies/qt.py
+++ b/mesonbuild/dependencies/qt.py
@@ -69,6 +69,12 @@ def get_qmake_host_bins(qvars: T.Dict[str, str]) -> str:
return qvars['QT_INSTALL_BINS']
+def get_qmake_host_libexecs(qvars: T.Dict[str, str]) -> T.Optional[str]:
+ if 'QT_HOST_LIBEXECS' in qvars:
+ return qvars['QT_HOST_LIBEXECS']
+ return qvars.get('QT_INSTALL_LIBEXECS')
+
+
def _get_modules_lib_suffix(version: str, info: 'MachineInfo', is_debug: bool) -> str:
"""Get the module suffix based on platform and debug type."""
suffix = ''
@@ -118,6 +124,7 @@ class _QtBase:
link_args: T.List[str]
clib_compiler: 'Compiler'
env: 'Environment'
+ libexecdir: T.Optional[str] = None
def __init__(self, name: str, kwargs: T.Dict[str, T.Any]):
self.qtname = name.capitalize()
@@ -277,6 +284,7 @@ class QmakeQtDependency(_QtBase, ConfigToolDependency, metaclass=abc.ABCMeta):
libdir = qvars['QT_INSTALL_LIBS']
# Used by qt.compilers_detect()
self.bindir = get_qmake_host_bins(qvars)
+ self.libexecdir = get_qmake_host_libexecs(qvars)
# Use the buildtype by default, but look at the b_vscrt option if the
# compiler supports it.
@@ -353,6 +361,7 @@ class QmakeQtDependency(_QtBase, ConfigToolDependency, metaclass=abc.ABCMeta):
self.is_found = True
# Used by self.compilers_detect()
self.bindir = get_qmake_host_bins(qvars)
+ self.libexecdir = get_qmake_host_libexecs(qvars)
def log_info(self) -> str:
return 'qmake'
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
index 99581a4..cb8a202 100644
--- a/mesonbuild/modules/qt.py
+++ b/mesonbuild/modules/qt.py
@@ -131,6 +131,8 @@ class QtBaseModule(ExtensionModule):
for b in self.tools:
if qt_dep.bindir:
yield os.path.join(qt_dep.bindir, b), b
+ if qt_dep.libexecdir:
+ yield os.path.join(qt_dep.libexecdir, b), b
# prefer the <tool>-qt<version> of the tool to the plain one, as we
# don't know what the unsuffixed one points to without calling it.
yield f'{b}-qt{qt_dep.qtver}', b