aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/interpreter/dependencyfallbacks.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/mesonbuild/interpreter/dependencyfallbacks.py b/mesonbuild/interpreter/dependencyfallbacks.py
index 3fbce42..54be990 100644
--- a/mesonbuild/interpreter/dependencyfallbacks.py
+++ b/mesonbuild/interpreter/dependencyfallbacks.py
@@ -66,14 +66,6 @@ class DependencyFallbacksHolder(MesonInterpreterObject):
self._subproject_impl(subp_name, varname)
def _subproject_impl(self, subp_name: str, varname: str) -> None:
- if not varname:
- # If no variable name is specified, check if the wrap file has one.
- # If the wrap file has a variable name, better use it because the
- # subproject most probably is not using meson.override_dependency().
- for name in self.names:
- varname = self.wrap_resolver.get_varname(subp_name, name)
- if varname:
- break
assert self.subproject_name is None
self.subproject_name = subp_name
self.subproject_varname = varname
@@ -175,6 +167,14 @@ class DependencyFallbacksHolder(MesonInterpreterObject):
# Legacy: Use the variable name if provided instead of relying on the
# subproject to override one of our dependency names
if not varname:
+ # If no variable name is specified, check if the wrap file has one.
+ # If the wrap file has a variable name, better use it because the
+ # subproject most probably is not using meson.override_dependency().
+ for name in self.names:
+ varname = self.wrap_resolver.get_varname(subp_name, name)
+ if varname:
+ break
+ if not varname:
mlog.warning(f'Subproject {subp_name!r} did not override {self._display_name!r} dependency and no variable name specified')
mlog.log('Dependency', mlog.bold(self._display_name), 'from subproject',
mlog.bold(subproject.subdir), 'found:', mlog.red('NO'))