aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/qt5.py
diff options
context:
space:
mode:
authorAaron Small <a.small@unb.ca>2017-03-21 23:38:24 -0400
committerAaron Small <a.small@unb.ca>2017-04-09 03:31:39 -0400
commit76c8491d770d558d4140789e01a9cb74701600ff (patch)
treebc55211a73dfc410bd811db6762373ebb32294d6 /mesonbuild/modules/qt5.py
parentb89af8b6dd0efc97867be96e91630d8a1c4d3316 (diff)
downloadmeson-76c8491d770d558d4140789e01a9cb74701600ff.zip
meson-76c8491d770d558d4140789e01a9cb74701600ff.tar.gz
meson-76c8491d770d558d4140789e01a9cb74701600ff.tar.bz2
Add an option to dependencies called 'method'. This can be used to
configure a detection method, for those types of dependencies that have more than one means of detection. The default detection methods are unchanged if 'method' is not specified, and all dependencies support the method 'auto', which is the same as not specifying a method. The dependencies which do support multiple detection methods additionally support other values, depending on the dependency.
Diffstat (limited to 'mesonbuild/modules/qt5.py')
-rw-r--r--mesonbuild/modules/qt5.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/modules/qt5.py b/mesonbuild/modules/qt5.py
index 2a87a80..6497694 100644
--- a/mesonbuild/modules/qt5.py
+++ b/mesonbuild/modules/qt5.py
@@ -24,14 +24,14 @@ from . import ModuleReturnValue
class Qt5Module(ExtensionModule):
tools_detected = False
- def _detect_tools(self, env):
+ def _detect_tools(self, env, method):
if self.tools_detected:
return
mlog.log('Detecting Qt5 tools')
# FIXME: We currently require Qt5 to exist while importing the module.
# We should make it gracefully degrade and not create any targets if
# the import is marked as 'optional' (not implemented yet)
- kwargs = {'required': 'true', 'modules': 'Core', 'silent': 'true'}
+ kwargs = {'required': 'true', 'modules': 'Core', 'silent': 'true', 'method': method}
qt5 = Qt5Dependency(env, kwargs)
# Get all tools and then make sure that they are the right version
self.moc, self.uic, self.rcc = qt5.compilers_detect()
@@ -119,7 +119,8 @@ class Qt5Module(ExtensionModule):
if not isinstance(sources, list):
sources = [sources]
sources += args[1:]
- self._detect_tools(state.environment)
+ method = kwargs.get('method', 'auto')
+ self._detect_tools(state.environment, method)
err_msg = "{0} sources specified and couldn't find {1}, " \
"please check your qt5 installation"
if len(moc_headers) + len(moc_sources) > 0 and not self.moc.found():