aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2020-01-17 00:53:17 +0000
committerNirbheek Chauhan <nirbheek@centricular.com>2020-01-23 14:49:45 +0530
commit4511ac3aeafef94066d58c6b8a6a6d718c3cb40d (patch)
treee3b7e2e15cabe89c19f37bc078a613a95dc426e3
parenta948f41aea654dd2ef505941d63d209097250a58 (diff)
downloadmeson-4511ac3aeafef94066d58c6b8a6a6d718c3cb40d.zip
meson-4511ac3aeafef94066d58c6b8a6a6d718c3cb40d.tar.gz
meson-4511ac3aeafef94066d58c6b8a6a6d718c3cb40d.tar.bz2
Fix dependency('qt') crash with old Qt on OSX
Don't fail with 'KeyError: QMAKE_XSPEC' if `qmake -query` doesn't report QMAKE_XSPEC. (Seen with 4.8.7)
-rw-r--r--mesonbuild/dependencies/ui.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py
index bdcc4a7..da411ef 100644
--- a/mesonbuild/dependencies/ui.py
+++ b/mesonbuild/dependencies/ui.py
@@ -373,7 +373,8 @@ class QtBaseDependency(ExternalDependency):
(k, v) = tuple(line.split(':', 1))
qvars[k] = v
# Qt on macOS uses a framework, but Qt for iOS/tvOS does not
- if self.env.machines.host.is_darwin() and 'ios' not in qvars['QMAKE_XSPEC'] and 'tvos' not in qvars['QMAKE_XSPEC']:
+ 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, mods, kwargs)
return qmake