diff options
author | nikolayp <nikolay.a.petrov@gmail.com> | 2020-01-31 21:08:20 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-02-05 22:16:54 +0200 |
commit | 42931a82e12f79bf2c428fded0f1a9609e1dcb83 (patch) | |
tree | 4e300fe1ba5b580d5a95c7d46d55fee9c39b190e /mesonbuild/dependencies/ui.py | |
parent | 6e29a11a4e3258631e3381909390c8eb46b16dd2 (diff) | |
download | meson-42931a82e12f79bf2c428fded0f1a9609e1dcb83.zip meson-42931a82e12f79bf2c428fded0f1a9609e1dcb83.tar.gz meson-42931a82e12f79bf2c428fded0f1a9609e1dcb83.tar.bz2 |
depdenencies/qt: Second attempt to allow qt --no-framework on MacOS.
Sometimes qt can be installed not as framework on MacOS. One way to
achieve this behaviour is to use conan package manager.
Allow falling back to simple library search if framework was
not found. In addition, allow to find the debug version of qt debug
libraries which have "_debug" suffix added to them.
Fixes #5091
Diffstat (limited to 'mesonbuild/dependencies/ui.py')
-rw-r--r-- | mesonbuild/dependencies/ui.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py index 11d6e88..31f02e5 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py @@ -363,7 +363,12 @@ class QtBaseDependency(ExternalDependency): 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, mods, kwargs) - return self.qmake.name + # 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 self.qmake.name + else: + 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'] @@ -413,6 +418,9 @@ class QtBaseDependency(ExternalDependency): suffix += 'd' if self.qtver == '4': suffix += '4' + if self.env.machines[self.for_machine].is_darwin(): + if is_debug: + suffix += '_debug' return suffix def _link_with_qtmain(self, is_debug, libdir): @@ -435,8 +443,8 @@ class QtBaseDependency(ExternalDependency): fname = 'Qt' + m mlog.debug('Looking for qt framework ' + fname) fwdep = QtExtraFrameworkDependency(fname, self.env, fw_kwargs, language=self.language) - self.compile_args.append('-F' + libdir) if fwdep.found(): + self.compile_args.append('-F' + libdir) self.compile_args += fwdep.get_compile_args(with_private_headers=self.private_headers, qt_version=self.version) self.link_args += fwdep.get_link_args() @@ -444,8 +452,8 @@ class QtBaseDependency(ExternalDependency): break else: self.is_found = True - # Used by self.compilers_detect() - self.bindir = self.get_qmake_host_bins(qvars) + # Used by self.compilers_detect() + self.bindir = self.get_qmake_host_bins(qvars) def get_qmake_host_bins(self, qvars): # Prefer QT_HOST_BINS (qt5, correct for cross and native compiling) |