diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py index 1294479d6..dd11e2ddb 100644 --- a/mesonbuild/mconf.py +++ b/mesonbuild/mconf.py @@ -292,7 +292,7 @@ class Conf: if show_build_options: self.print_options('', build_core_options['']) self.print_options('Backend options', {k: v for k, v in self.coredata.optstore.items() if k.is_backend()}) - self.print_options('Base options', {k: v for k, v in self.coredata.optstore.items() if k.is_base()}) + self.print_options('Base options', {k: v for k, v in self.coredata.optstore.items() if self.coredata.optstore.is_base_option(k)}) self.print_options('Compiler options', host_compiler_options.get('', {})) if show_build_options: self.print_options('', build_compiler_options.get('', {})) diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index 17d1b08fb..a49c6e137 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -329,7 +329,7 @@ def list_buildoptions(coredata: cdata.CoreData, subprojects: T.Optional[T.List[s add_keys(core_options, 'core') add_keys({k: v for k, v in coredata.optstore.items() if k.is_backend()}, 'backend') - add_keys({k: v for k, v in coredata.optstore.items() if k.is_base()}, 'base') + add_keys({k: v for k, v in coredata.optstore.items() if coredata.optstore.is_base_option(k)}, 'base') add_keys( {k: v for k, v in sorted(coredata.optstore.items(), key=lambda i: i[0].machine) if k.is_compiler()}, 'compiler', diff --git a/mesonbuild/options.py b/mesonbuild/options.py index e88710d08..87f82ba63 100644 --- a/mesonbuild/options.py +++ b/mesonbuild/options.py @@ -544,3 +544,7 @@ class OptionStore: def is_reserved_name(self, key: OptionKey) -> bool: return not self.is_project_option(key) + + def is_base_option(self, key: OptionKey) -> bool: + """Convenience method to check if this is a base option.""" + return key.type is OptionType.BASE diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py index 080f2a76d..31f67693a 100644 --- a/mesonbuild/utils/universal.py +++ b/mesonbuild/utils/universal.py @@ -2403,10 +2403,6 @@ class OptionKey: """This method will be removed once we can delete OptionsView.""" return self.type is OptionType.PROJECT - def is_base(self) -> bool: - """Convenience method to check if this is a base option.""" - return self.type is OptionType.BASE - def pickle_load(filename: str, object_name: str, object_type: T.Type[_PL], suggest_reconfigure: bool = True) -> _PL: load_fail_msg = f'{object_name} file {filename!r} is corrupted.'