From 7f6e4495749f1cdc9700dd884d850a1ad6d198ff Mon Sep 17 00:00:00 2001 From: boulette42 Date: Sun, 15 Mar 2026 16:59:31 +0100 Subject: [PATCH] Fix evaluation of qt dependencies without qt framework If qt5 was built from source with parameter '-no-framework', meson did not find the Qt-libraries. Now instead of changing an internal flag, the return code of the probing function is used to determine the existence of the qt framework. The internal flag has to keep its value. This resolves #15560 --- mesonbuild/dependencies/qt.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/mesonbuild/dependencies/qt.py b/mesonbuild/dependencies/qt.py index aa321e92cdd7..913c08ebb84f 100644 --- a/mesonbuild/dependencies/qt.py +++ b/mesonbuild/dependencies/qt.py @@ -289,13 +289,11 @@ def __init__(self, name: str, env: 'Environment', kwargs: DependencyObjectKWs): xspec = qvars.get('QMAKE_XSPEC', '') if self.env.machines.host.is_darwin() and not any(s in xspec for s in ['ios', 'tvos']): mlog.debug("Building for macOS, looking for framework") - self._framework_detect(qvars, self.requested_modules, kwargs) + if self._framework_detect(qvars, self.requested_modules, kwargs): + return # Sometimes Qt is built not as a framework (for instance, when using conan pkg manager) # skip and fall back to normal procedure then - if self.is_found: - return - else: - mlog.debug("Building for macOS, couldn't find framework, falling back to library search") + mlog.debug("Building for macOS, couldn't find framework, falling back to library search") incdir = qvars['QT_INSTALL_HEADERS'] self.compile_args.append('-I' + incdir) libdir = qvars['QT_INSTALL_LIBS'] @@ -357,7 +355,7 @@ def get_variable_args(self, variable_name: str) -> T.List[str]: def get_private_includes(self, mod_inc_dir: str, module: str) -> T.List[str]: pass - def _framework_detect(self, qvars: T.Dict[str, str], modules: T.List[str], kwargs: DependencyObjectKWs) -> None: + def _framework_detect(self, qvars: T.Dict[str, str], modules: T.List[str], kwargs: DependencyObjectKWs) -> bool: libdir = qvars['QT_INSTALL_LIBS'] # ExtraFrameworkDependency doesn't support any methods @@ -376,13 +374,11 @@ def _framework_detect(self, qvars: T.Dict[str, str], modules: T.List[str], kwarg qt_version=self.version) self.link_args += fwdep.get_link_args() else: - self.is_found = False - break - else: - self.is_found = True - # Used by self.compilers_detect() - self.bindir = get_qmake_host_bins(qvars) - self.libexecdir = get_qmake_host_libexecs(qvars) + return False + # Used by self.compilers_detect() + self.bindir = get_qmake_host_bins(qvars) + self.libexecdir = get_qmake_host_libexecs(qvars) + return True def log_info(self) -> str: return 'qmake'