aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-05-30 02:22:20 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-05-30 03:35:02 +0530
commitc33e7a68a1ca1a528612934359a5b3d08005c0aa (patch)
treef556802a50a63465293d61fe02b13a0277acdbec /mesonbuild/interpreter.py
parentf2256ba0980d1d5eb22b202dacc15abd9249339a (diff)
downloadmeson-c33e7a68a1ca1a528612934359a5b3d08005c0aa.zip
meson-c33e7a68a1ca1a528612934359a5b3d08005c0aa.tar.gz
meson-c33e7a68a1ca1a528612934359a5b3d08005c0aa.tar.bz2
Also reuse subproject-based fallback dependencies
This allows a project to use the same fallbacks dependency from the same subproject multiple times in the same way that external dependencies can be. Also change the format of the dependency identifier to ensure that fallback checks with different dirname/varname aren't mistakenly reused. We now use a tuple for this because the format is simpler to construct and it gives us the same immutability guarantees as a string which is needed for using it as a dictionary key.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r--mesonbuild/interpreter.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 5a99e1c..1491767 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1626,7 +1626,9 @@ class Interpreter():
dep = dependencies.find_external_dependency(name, self.environment, kwargs)
except dependencies.DependencyException:
if 'fallback' in kwargs:
- return self.dependency_fallback(kwargs)
+ dep = self.dependency_fallback(kwargs)
+ self.coredata.deps[identifier] = dep.held_object
+ return dep
raise
self.coredata.deps[identifier] = dep
return DependencyHolder(dep)