Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions mesonbuild/dependencies/qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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
Expand All @@ -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'
Expand Down
Loading