diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-03-14 12:07:23 +0100 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-03-14 10:27:38 -0700 |
commit | 9d42e58ea2d673a63a9918f138b81d1bd6057e73 (patch) | |
tree | cf3855c10c3f5e063741855af43d266aab66bac1 /mesonbuild/modules/sourceset.py | |
parent | 076855c22ffdae28cc86816c9fd06b9c0e401702 (diff) | |
download | meson-9d42e58ea2d673a63a9918f138b81d1bd6057e73.zip meson-9d42e58ea2d673a63a9918f138b81d1bd6057e73.tar.gz meson-9d42e58ea2d673a63a9918f138b81d1bd6057e73.tar.bz2 |
sourceset: reinstate extra_deps
Dependencies in the "if_true" keyword argument do not prevent the
sources from being used; in other words, they work just like dependencies
with "disabler: false".
However, this was broken in commit ab0ffc6a2 ("modules/sourceset: Fix
remaining typing issues", 2022-02-23) which changed logic instead of
just fixing typing issues. This was likely an attempt to avoid using
"dependencies.Dependency" after the "dependencies" field was declared,
but it also broke QEMU.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild/modules/sourceset.py')
-rw-r--r-- | mesonbuild/modules/sourceset.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/modules/sourceset.py b/mesonbuild/modules/sourceset.py index f3ce0db..c03d180 100644 --- a/mesonbuild/modules/sourceset.py +++ b/mesonbuild/modules/sourceset.py @@ -63,6 +63,7 @@ class SourceSetRule(T.NamedTuple): if_false: T.Any sourcesets: T.List[SourceSetImpl] deps: T.List[dependencies.Dependency] + extra_deps: T.List[dependencies.Dependency] class SourceFiles(T.NamedTuple): @@ -159,7 +160,7 @@ class SourceSetImpl(SourceSet, MutableModuleObject): keys, dependencies = self.check_conditions(when) sources, extra_deps = self.check_source_files(if_true) if_false, _ = self.check_source_files(if_false) - self.rules.append(SourceSetRule(keys, sources, if_false, [], dependencies + extra_deps)) + self.rules.append(SourceSetRule(keys, sources, if_false, [], dependencies, extra_deps)) @typed_pos_args('sourceset.add_all', varargs=SourceSet) @typed_kwargs( @@ -187,7 +188,7 @@ class SourceSetImpl(SourceSet, MutableModuleObject): if not isinstance(s, SourceSetImpl): raise InvalidCode('Arguments to \'add_all\' after the first must be source sets') s.frozen = True - self.rules.append(SourceSetRule(keys, [], [], if_true, dependencies)) + self.rules.append(SourceSetRule(keys, [], [], if_true, dependencies, [])) def collect(self, enabled_fn: T.Callable[[str], bool], all_sources: bool, @@ -199,6 +200,7 @@ class SourceSetImpl(SourceSet, MutableModuleObject): all(enabled_fn(key) for key in entry.keys): into.sources.update(entry.sources) into.deps.update(entry.deps) + into.deps.update(entry.extra_deps) for ss in entry.sourcesets: ss.collect(enabled_fn, all_sources, into) if not all_sources: |