diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-03-14 15:11:16 +0100 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-03-14 10:27:38 -0700 |
commit | 7c20890a05481e97eee57a147f50237087a1c94e (patch) | |
tree | f80f0dfff7a24c794bd3249c09209e802ca40ce1 /mesonbuild/modules | |
parent | 94be5b8b48866d22d398326d45935ce2eff63beb (diff) | |
download | meson-7c20890a05481e97eee57a147f50237087a1c94e.zip meson-7c20890a05481e97eee57a147f50237087a1c94e.tar.gz meson-7c20890a05481e97eee57a147f50237087a1c94e.tar.bz2 |
sourceset: reorder fields in SourceSetRule
Keep conditions first, then "if true" fields, and the if_false sources last.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/sourceset.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mesonbuild/modules/sourceset.py b/mesonbuild/modules/sourceset.py index e6ba9ff..f091f6e 100644 --- a/mesonbuild/modules/sourceset.py +++ b/mesonbuild/modules/sourceset.py @@ -61,21 +61,21 @@ class SourceSetRule(T.NamedTuple): keys: T.List[str] """Configuration keys that enable this rule if true""" + deps: T.List[dependencies.Dependency] + """Dependencies that enable this rule if true""" + sources: T.List[T.Union[mesonlib.FileOrString, build.GeneratedTypes]] """Source files added when this rule's conditions are true""" - if_false: T.List[T.Union[mesonlib.FileOrString, build.GeneratedTypes]] - """Source files added when this rule's conditons are false""" + extra_deps: T.List[dependencies.Dependency] + """Dependencies added when this rule's conditions are true, but + that do not make the condition false if they're absent.""" sourcesets: T.List[SourceSetImpl] """Other sourcesets added when this rule's conditions are true""" - deps: T.List[dependencies.Dependency] - """Dependencies that enable this rule if true""" - - extra_deps: T.List[dependencies.Dependency] - """Dependencies added when this rule's conditions are true, but - that do not make the condition false if they're absent.""" + if_false: T.List[T.Union[mesonlib.FileOrString, build.GeneratedTypes]] + """Source files added when this rule's conditons are false""" class SourceFiles(T.NamedTuple): @@ -172,7 +172,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, dependencies, sources, extra_deps, [], if_false)) @typed_pos_args('sourceset.add_all', varargs=SourceSet) @typed_kwargs( @@ -200,7 +200,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, dependencies, [], [], if_true, [])) def collect(self, enabled_fn: T.Callable[[str], bool], all_sources: bool, |