aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/ast/introspection.py2
-rw-r--r--mesonbuild/backend/ninjabackend.py16
-rw-r--r--mesonbuild/backend/vs2010backend.py2
-rw-r--r--mesonbuild/build.py10
-rw-r--r--mesonbuild/cmake/common.py4
-rw-r--r--mesonbuild/cmake/executor.py2
-rw-r--r--mesonbuild/cmake/interpreter.py2
-rw-r--r--mesonbuild/compilers/cuda.py2
-rw-r--r--mesonbuild/compilers/mixins/clike.py4
-rw-r--r--mesonbuild/compilers/mixins/emscripten.py2
-rw-r--r--mesonbuild/coredata.py94
-rw-r--r--mesonbuild/dependencies/boost.py4
-rw-r--r--mesonbuild/dependencies/pkgconfig.py4
-rw-r--r--mesonbuild/dependencies/python.py4
-rw-r--r--mesonbuild/dependencies/qt.py4
-rw-r--r--mesonbuild/interpreter/compiler.py2
-rw-r--r--mesonbuild/interpreter/interpreter.py22
-rw-r--r--mesonbuild/interpreter/interpreterobjects.py2
-rw-r--r--mesonbuild/mconf.py16
-rw-r--r--mesonbuild/mintro.py10
-rw-r--r--mesonbuild/modules/gnome.py2
-rw-r--r--mesonbuild/modules/python.py2
-rw-r--r--mesonbuild/modules/rust.py2
-rw-r--r--mesonbuild/msetup.py4
-rw-r--r--mesonbuild/rewriter.py10
-rwxr-xr-xrun_tests.py2
-rw-r--r--unittests/allplatformstests.py60
-rw-r--r--unittests/datatests.py6
-rw-r--r--unittests/internaltests.py2
-rw-r--r--unittests/linuxliketests.py2
30 files changed, 150 insertions, 150 deletions
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py
index c7dcf73..1d7dd05 100644
--- a/mesonbuild/ast/introspection.py
+++ b/mesonbuild/ast/introspection.py
@@ -182,7 +182,7 @@ class IntrospectionInterpreter(AstInterpreter):
if self.subproject:
options = {}
for k in comp.get_options():
- v = copy.copy(self.coredata.options[k])
+ v = copy.copy(self.coredata.optstore[k])
k = k.evolve(subproject=self.subproject)
options[k] = v
self.coredata.add_compiler_options(options, lang, for_machine, self.environment, self.subproject)
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 4d56f7d..debde7b 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -623,7 +623,7 @@ class NinjaBackend(backends.Backend):
outfile.write('# Do not edit by hand.\n\n')
outfile.write('ninja_required_version = 1.8.2\n\n')
- num_pools = self.environment.coredata.options[OptionKey('backend_max_links')].value
+ num_pools = self.environment.coredata.optstore[OptionKey('backend_max_links')].value
if num_pools > 0:
outfile.write(f'''pool link_pool
depth = {num_pools}
@@ -656,8 +656,8 @@ class NinjaBackend(backends.Backend):
self.generate_dist()
mlog.log_timestamp("Dist generated")
key = OptionKey('b_coverage')
- if (key in self.environment.coredata.options and
- self.environment.coredata.options[key].value):
+ if (key in self.environment.coredata.optstore and
+ self.environment.coredata.optstore[key].value):
gcovr_exe, gcovr_version, lcov_exe, lcov_version, genhtml_exe, llvm_cov_exe = environment.find_coverage_tools(self.environment.coredata)
mlog.debug(f'Using {gcovr_exe} ({gcovr_version}), {lcov_exe} and {llvm_cov_exe} for code coverage')
if gcovr_exe or (lcov_exe and genhtml_exe):
@@ -2287,7 +2287,7 @@ class NinjaBackend(backends.Backend):
return options
def generate_static_link_rules(self):
- num_pools = self.environment.coredata.options[OptionKey('backend_max_links')].value
+ num_pools = self.environment.coredata.optstore[OptionKey('backend_max_links')].value
if 'java' in self.environment.coredata.compilers.host:
self.generate_java_link()
for for_machine in MachineChoice:
@@ -2335,7 +2335,7 @@ class NinjaBackend(backends.Backend):
self.add_rule(NinjaRule(rule, cmdlist, args, description, **options, extra=pool))
def generate_dynamic_link_rules(self):
- num_pools = self.environment.coredata.options[OptionKey('backend_max_links')].value
+ num_pools = self.environment.coredata.optstore[OptionKey('backend_max_links')].value
for for_machine in MachineChoice:
complist = self.environment.coredata.compilers[for_machine]
for langname, compiler in complist.items():
@@ -3597,7 +3597,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
def get_user_option_args(self):
cmds = []
- for (k, v) in self.environment.coredata.options.items():
+ for k, v in self.environment.coredata.optstore.items():
if k.is_project():
cmds.append('-D' + str(k) + '=' + (v.value if isinstance(v.value, str) else str(v.value).lower()))
# The order of these arguments must be the same between runs of Meson
@@ -3726,8 +3726,8 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
if ctlist:
elem.add_dep(self.generate_custom_target_clean(ctlist))
- if OptionKey('b_coverage') in self.environment.coredata.options and \
- self.environment.coredata.options[OptionKey('b_coverage')].value:
+ if OptionKey('b_coverage') in self.environment.coredata.optstore and \
+ self.environment.coredata.optstore[OptionKey('b_coverage')].value:
self.generate_gcov_clean()
elem.add_dep('clean-gcda')
elem.add_dep('clean-gcno')
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index 91275c7..b2b8d87 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -532,7 +532,7 @@ class Vs2010Backend(backends.Backend):
replace_if_different(sln_filename, sln_filename_tmp)
def generate_projects(self, vslite_ctx: dict = None) -> T.List[Project]:
- startup_project = self.environment.coredata.options[OptionKey('backend_startup_project')].value
+ startup_project = self.environment.coredata.optstore[OptionKey('backend_startup_project')].value
projlist: T.List[Project] = []
startup_idx = 0
for (i, (name, target)) in enumerate(self.build.targets.items()):
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 313f73e..517845c 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -533,7 +533,7 @@ class Target(HoldableObject, metaclass=abc.ABCMeta):
for k, v in overrides.items()}
else:
ovr = {}
- self.options = coredata.OptionsView(self.environment.coredata.options, self.subproject, ovr)
+ self.options = coredata.OptionsView(self.environment.coredata.optstore, self.subproject, ovr)
# XXX: this should happen in the interpreter
if has_path_sep(self.name):
# Fix failing test 53 when this becomes an error.
@@ -1242,8 +1242,8 @@ class BuildTarget(Target):
k = OptionKey(option)
if kwargs.get(arg) is not None:
val = T.cast('bool', kwargs[arg])
- elif k in self.environment.coredata.options:
- val = self.environment.coredata.options[k].value
+ elif k in self.environment.coredata.optstore:
+ val = self.environment.coredata.optstore[k].value
else:
val = False
@@ -1930,8 +1930,8 @@ class Executable(BuildTarget):
compilers: T.Dict[str, 'Compiler'],
kwargs):
key = OptionKey('b_pie')
- if 'pie' not in kwargs and key in environment.coredata.options:
- kwargs['pie'] = environment.coredata.options[key].value
+ if 'pie' not in kwargs and key in environment.coredata.optstore:
+ kwargs['pie'] = environment.coredata.optstore[key].value
super().__init__(name, subdir, subproject, for_machine, sources, structured_sources, objects,
environment, compilers, kwargs)
self.win_subsystem = kwargs.get('win_subsystem') or 'console'
diff --git a/mesonbuild/cmake/common.py b/mesonbuild/cmake/common.py
index f117a9f..0264819 100644
--- a/mesonbuild/cmake/common.py
+++ b/mesonbuild/cmake/common.py
@@ -51,9 +51,9 @@ blacklist_cmake_defs = [
]
def cmake_is_debug(env: 'Environment') -> bool:
- if OptionKey('b_vscrt') in env.coredata.options:
+ if OptionKey('b_vscrt') in env.coredata.optstore:
is_debug = env.coredata.get_option(OptionKey('buildtype')) == 'debug'
- if env.coredata.options[OptionKey('b_vscrt')].value in {'mdd', 'mtd'}:
+ if env.coredata.optstore[OptionKey('b_vscrt')].value in {'mdd', 'mtd'}:
is_debug = True
return is_debug
else:
diff --git a/mesonbuild/cmake/executor.py b/mesonbuild/cmake/executor.py
index dd43cc0..a8850d6 100644
--- a/mesonbuild/cmake/executor.py
+++ b/mesonbuild/cmake/executor.py
@@ -51,7 +51,7 @@ class CMakeExecutor:
self.cmakebin = None
return
- self.prefix_paths = self.environment.coredata.options[OptionKey('cmake_prefix_path', machine=self.for_machine)].value
+ self.prefix_paths = self.environment.coredata.optstore[OptionKey('cmake_prefix_path', machine=self.for_machine)].value
if self.prefix_paths:
self.extra_cmake_args += ['-DCMAKE_PREFIX_PATH={}'.format(';'.join(self.prefix_paths))]
diff --git a/mesonbuild/cmake/interpreter.py b/mesonbuild/cmake/interpreter.py
index 4c42dbb..57354d3 100644
--- a/mesonbuild/cmake/interpreter.py
+++ b/mesonbuild/cmake/interpreter.py
@@ -532,7 +532,7 @@ class ConverterTarget:
@lru_cache(maxsize=None)
def _all_lang_stds(self, lang: str) -> 'ImmutableListProtocol[str]':
try:
- res = self.env.coredata.options[OptionKey('std', machine=MachineChoice.BUILD, lang=lang)].choices
+ res = self.env.coredata.optstore[OptionKey('std', machine=MachineChoice.BUILD, lang=lang)].choices
except KeyError:
return []
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py
index 954040e..5a93551 100644
--- a/mesonbuild/compilers/cuda.py
+++ b/mesonbuild/compilers/cuda.py
@@ -549,7 +549,7 @@ class CudaCompiler(Compiler):
# Use the -ccbin option, if available, even during sanity checking.
# Otherwise, on systems where CUDA does not support the default compiler,
# NVCC becomes unusable.
- flags += self.get_ccbin_args(env.coredata.options)
+ flags += self.get_ccbin_args(env.coredata.optstore)
# If cross-compiling, we can't run the sanity check, only compile it.
if env.need_exe_wrapper(self.for_machine) and not env.has_exe_wrapper():
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
index d273015..87cb819 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -376,8 +376,8 @@ class CLikeCompiler(Compiler):
# linking with static libraries since MSVC won't select a CRT for
# us in that case and will error out asking us to pick one.
try:
- crt_val = env.coredata.options[OptionKey('b_vscrt')].value
- buildtype = env.coredata.options[OptionKey('buildtype')].value
+ crt_val = env.coredata.optstore[OptionKey('b_vscrt')].value
+ buildtype = env.coredata.optstore[OptionKey('buildtype')].value
cargs += self.get_crt_compile_args(crt_val, buildtype)
except (KeyError, AttributeError):
pass
diff --git a/mesonbuild/compilers/mixins/emscripten.py b/mesonbuild/compilers/mixins/emscripten.py
index 110dbc6..8d3dc95 100644
--- a/mesonbuild/compilers/mixins/emscripten.py
+++ b/mesonbuild/compilers/mixins/emscripten.py
@@ -51,7 +51,7 @@ class EmscriptenMixin(Compiler):
def thread_link_flags(self, env: 'Environment') -> T.List[str]:
args = ['-pthread']
- count: int = env.coredata.options[OptionKey('thread_count', lang=self.language, machine=self.for_machine)].value
+ count: int = env.coredata.optstore[OptionKey('thread_count', lang=self.language, machine=self.for_machine)].value
if count:
args.append(f'-sPTHREAD_POOL_SIZE={count}')
return args
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index e4081e3..8804547 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -255,7 +255,7 @@ class CoreData:
self.meson_command = meson_command
self.target_guids = {}
self.version = version
- self.options = options.OptionStore()
+ self.optstore = options.OptionStore()
self.cross_files = self.__load_config_files(cmd_options, scratch_dir, 'cross')
self.compilers: PerMachine[T.Dict[str, Compiler]] = PerMachine(OrderedDict(), OrderedDict())
@@ -272,8 +272,8 @@ class CoreData:
# For host == build configurations these caches should be the same.
self.deps: PerMachine[DependencyCache] = PerMachineDefaultable.default(
self.is_cross_build(),
- DependencyCache(self.options, MachineChoice.BUILD),
- DependencyCache(self.options, MachineChoice.HOST))
+ DependencyCache(self.optstore, MachineChoice.BUILD),
+ DependencyCache(self.optstore, MachineChoice.HOST))
self.compiler_check_cache: T.Dict['CompilerCheckCacheKey', 'CompileResult'] = OrderedDict()
self.run_check_cache: T.Dict['RunCheckCacheKey', 'RunResult'] = OrderedDict()
@@ -403,10 +403,10 @@ class CoreData:
def init_builtins(self, subproject: str) -> None:
# Create builtin options with default values
for key, opt in options.BUILTIN_OPTIONS.items():
- self.add_builtin_option(self.options, key.evolve(subproject=subproject), opt)
+ self.add_builtin_option(self.optstore, key.evolve(subproject=subproject), opt)
for for_machine in iter(MachineChoice):
for key, opt in options.BUILTIN_OPTIONS_PER_MACHINE.items():
- self.add_builtin_option(self.options, key.evolve(subproject=subproject, machine=for_machine), opt)
+ self.add_builtin_option(self.optstore, key.evolve(subproject=subproject, machine=for_machine), opt)
@staticmethod
def add_builtin_option(opts_map: 'MutableKeyedOptionDictType', key: OptionKey,
@@ -422,26 +422,26 @@ class CoreData:
def init_backend_options(self, backend_name: str) -> None:
if backend_name == 'ninja':
- self.options[OptionKey('backend_max_links')] = options.UserIntegerOption(
+ self.optstore[OptionKey('backend_max_links')] = options.UserIntegerOption(
'backend_max_links',
'Maximum number of linker processes to run or 0 for no '
'limit',
(0, None, 0))
elif backend_name.startswith('vs'):
- self.options[OptionKey('backend_startup_project')] = options.UserStringOption(
+ self.optstore[OptionKey('backend_startup_project')] = options.UserStringOption(
'backend_startup_project',
'Default project to execute in Visual Studio',
'')
def get_option(self, key: OptionKey) -> T.Union[T.List[str], str, int, bool]:
try:
- v = self.options[key].value
+ v = self.optstore[key].value
return v
except KeyError:
pass
try:
- v = self.options[key.as_root()]
+ v = self.optstore[key.as_root()]
if v.yielding:
return v.value
except KeyError:
@@ -455,11 +455,11 @@ class CoreData:
if key.name == 'prefix':
value = self.sanitize_prefix(value)
else:
- prefix = self.options[OptionKey('prefix')].value
+ prefix = self.optstore[OptionKey('prefix')].value
value = self.sanitize_dir_option_value(prefix, key, value)
try:
- opt = self.options[key]
+ opt = self.optstore[key]
except KeyError:
raise MesonException(f'Tried to set unknown builtin option {str(key)}')
@@ -510,7 +510,7 @@ class CoreData:
def get_nondefault_buildtype_args(self) -> T.List[T.Union[T.Tuple[str, str, str], T.Tuple[str, bool, bool]]]:
result: T.List[T.Union[T.Tuple[str, str, str], T.Tuple[str, bool, bool]]] = []
- value = self.options[OptionKey('buildtype')].value
+ value = self.optstore[OptionKey('buildtype')].value
if value == 'plain':
opt = 'plain'
debug = False
@@ -529,8 +529,8 @@ class CoreData:
else:
assert value == 'custom'
return []
- actual_opt = self.options[OptionKey('optimization')].value
- actual_debug = self.options[OptionKey('debug')].value
+ actual_opt = self.optstore[OptionKey('optimization')].value
+ actual_debug = self.optstore[OptionKey('debug')].value
if actual_opt != opt:
result.append(('optimization', actual_opt, opt))
if actual_debug != debug:
@@ -559,8 +559,8 @@ class CoreData:
assert value == 'custom'
return False
- dirty |= self.options[OptionKey('optimization')].set_value(opt)
- dirty |= self.options[OptionKey('debug')].set_value(debug)
+ dirty |= self.optstore[OptionKey('optimization')].set_value(opt)
+ dirty |= self.optstore[OptionKey('debug')].set_value(debug)
return dirty
@@ -572,30 +572,30 @@ class CoreData:
def get_external_args(self, for_machine: MachineChoice, lang: str) -> T.List[str]:
# mypy cannot analyze type of OptionKey
- return T.cast('T.List[str]', self.options[OptionKey('args', machine=for_machine, lang=lang)].value)
+ return T.cast('T.List[str]', self.optstore[OptionKey('args', machine=for_machine, lang=lang)].value)
def get_external_link_args(self, for_machine: MachineChoice, lang: str) -> T.List[str]:
# mypy cannot analyze type of OptionKey
- return T.cast('T.List[str]', self.options[OptionKey('link_args', machine=for_machine, lang=lang)].value)
+ return T.cast('T.List[str]', self.optstore[OptionKey('link_args', machine=for_machine, lang=lang)].value)
def update_project_options(self, options: 'MutableKeyedOptionDictType', subproject: SubProject) -> None:
for key, value in options.items():
if not key.is_project():
continue
- if key not in self.options:
- self.options[key] = value
+ if key not in self.optstore:
+ self.optstore[key] = value
continue
if key.subproject != subproject:
raise MesonBugException(f'Tried to set an option for subproject {key.subproject} from {subproject}!')
- oldval = self.options[key]
+ oldval = self.optstore[key]
if type(oldval) is not type(value):
- self.options[key] = value
+ self.optstore[key] = value
elif oldval.choices != value.choices:
# If the choices have changed, use the new value, but attempt
# to keep the old options. If they are not valid keep the new
# defaults but warn.
- self.options[key] = value
+ self.optstore[key] = value
try:
value.set_value(oldval.value)
except MesonException:
@@ -603,9 +603,9 @@ class CoreData:
fatal=False)
# Find any extranious keys for this project and remove them
- for key in self.options.keys() - options.keys():
+ for key in self.optstore.keys() - options.keys():
if key.is_project() and key.subproject == subproject:
- del self.options[key]
+ del self.optstore[key]
def is_cross_build(self, when_building_for: MachineChoice = MachineChoice.HOST) -> bool:
if when_building_for == MachineChoice.BUILD:
@@ -616,13 +616,13 @@ class CoreData:
dirty = False
assert not self.is_cross_build()
for k in options.BUILTIN_OPTIONS_PER_MACHINE:
- o = self.options[k]
- dirty |= self.options[k.as_build()].set_value(o.value)
- for bk, bv in self.options.items():
+ o = self.optstore[k]
+ dirty |= self.optstore[k.as_build()].set_value(o.value)
+ for bk, bv in self.optstore.items():
if bk.machine is MachineChoice.BUILD:
hk = bk.as_host()
try:
- hv = self.options[hk]
+ hv = self.optstore[hk]
dirty |= bv.set_value(hv.value)
except KeyError:
continue
@@ -637,16 +637,16 @@ class CoreData:
pfk = OptionKey('prefix')
if pfk in opts_to_set:
prefix = self.sanitize_prefix(opts_to_set[pfk])
- dirty |= self.options[OptionKey('prefix')].set_value(prefix)
+ dirty |= self.optstore[OptionKey('prefix')].set_value(prefix)
for key in options.BUILTIN_DIR_NOPREFIX_OPTIONS:
if key not in opts_to_set:
- dirty |= self.options[key].set_value(options.BUILTIN_OPTIONS[key].prefixed_default(key, prefix))
+ dirty |= self.optstore[key].set_value(options.BUILTIN_OPTIONS[key].prefixed_default(key, prefix))
unknown_options: T.List[OptionKey] = []
for k, v in opts_to_set.items():
if k == pfk:
continue
- elif k in self.options:
+ elif k in self.optstore:
dirty |= self.set_option(k, v, first_invocation)
elif k.machine != MachineChoice.BUILD and k.type != OptionType.COMPILER:
unknown_options.append(k)
@@ -690,7 +690,7 @@ class CoreData:
# Always test this using the HOST machine, as many builtin options
# are not valid for the BUILD machine, but the yielding value does
# not differ between them even when they are valid for both.
- if subproject and k.is_builtin() and self.options[k.evolve(subproject='', machine=MachineChoice.HOST)].yielding:
+ if subproject and k.is_builtin() and self.optstore[k.evolve(subproject='', machine=MachineChoice.HOST)].yielding:
continue
# Skip base, compiler, and backend options, they are handled when
# adding languages and setting backend.
@@ -710,16 +710,16 @@ class CoreData:
if value is not None:
o.set_value(value)
if not subproject:
- self.options[k] = o # override compiler option on reconfigure
- self.options.setdefault(k, o)
+ self.optstore[k] = o # override compiler option on reconfigure
+ self.optstore.setdefault(k, o)
if subproject:
sk = k.evolve(subproject=subproject)
value = env.options.get(sk) or value
if value is not None:
o.set_value(value)
- self.options[sk] = o # override compiler option on reconfigure
- self.options.setdefault(sk, o)
+ self.optstore[sk] = o # override compiler option on reconfigure
+ self.optstore.setdefault(sk, o)
def add_lang_args(self, lang: str, comp: T.Type['Compiler'],
for_machine: MachineChoice, env: 'Environment') -> None:
@@ -727,8 +727,8 @@ class CoreData:
from .compilers import compilers
# These options are all new at this point, because the compiler is
# responsible for adding its own options, thus calling
- # `self.options.update()`` is perfectly safe.
- self.options.update(compilers.get_global_options(lang, comp, for_machine, env))
+ # `self.optstore.update()`` is perfectly safe.
+ self.optstore.update(compilers.get_global_options(lang, comp, for_machine, env))
def process_compiler_options(self, lang: str, comp: Compiler, env: Environment, subproject: str) -> None:
from . import compilers
@@ -741,20 +741,20 @@ class CoreData:
skey = key.evolve(subproject=subproject)
else:
skey = key
- if skey not in self.options:
- self.options[skey] = copy.deepcopy(compilers.base_options[key])
+ if skey not in self.optstore:
+ self.optstore[skey] = copy.deepcopy(compilers.base_options[key])
if skey in env.options:
- self.options[skey].set_value(env.options[skey])
+ self.optstore[skey].set_value(env.options[skey])
enabled_opts.append(skey)
elif subproject and key in env.options:
- self.options[skey].set_value(env.options[key])
+ self.optstore[skey].set_value(env.options[key])
enabled_opts.append(skey)
- if subproject and key not in self.options:
- self.options[key] = copy.deepcopy(self.options[skey])
+ if subproject and key not in self.optstore:
+ self.optstore[key] = copy.deepcopy(self.optstore[skey])
elif skey in env.options:
- self.options[skey].set_value(env.options[skey])
+ self.optstore[skey].set_value(env.options[skey])
elif subproject and key in env.options:
- self.options[skey].set_value(env.options[key])
+ self.optstore[skey].set_value(env.options[key])
self.emit_base_options_warnings(enabled_opts)
def emit_base_options_warnings(self, enabled_opts: T.List[OptionKey]) -> None:
diff --git a/mesonbuild/dependencies/boost.py b/mesonbuild/dependencies/boost.py
index cccc0c3..39b3cfe 100644
--- a/mesonbuild/dependencies/boost.py
+++ b/mesonbuild/dependencies/boost.py
@@ -580,8 +580,8 @@ class BoostDependency(SystemDependency):
# MSVC is very picky with the library tags
vscrt = ''
try:
- crt_val = self.env.coredata.options[mesonlib.OptionKey('b_vscrt')].value
- buildtype = self.env.coredata.options[mesonlib.OptionKey('buildtype')].value
+ crt_val = self.env.coredata.optstore[mesonlib.OptionKey('b_vscrt')].value
+ buildtype = self.env.coredata.optstore[mesonlib.OptionKey('buildtype')].value
vscrt = self.clib_compiler.get_crt_compile_args(crt_val, buildtype)[0]
except (KeyError, IndexError, AttributeError):
pass
diff --git a/mesonbuild/dependencies/pkgconfig.py b/mesonbuild/dependencies/pkgconfig.py
index 30e3d28..b6647b4 100644
--- a/mesonbuild/dependencies/pkgconfig.py
+++ b/mesonbuild/dependencies/pkgconfig.py
@@ -238,7 +238,7 @@ class PkgConfigCLI(PkgConfigInterface):
def _get_env(self, uninstalled: bool = False) -> EnvironmentVariables:
env = EnvironmentVariables()
key = OptionKey('pkg_config_path', machine=self.for_machine)
- extra_paths: T.List[str] = self.env.coredata.options[key].value[:]
+ extra_paths: T.List[str] = self.env.coredata.optstore[key].value[:]
if uninstalled:
uninstalled_path = Path(self.env.get_build_dir(), 'meson-uninstalled').as_posix()
if uninstalled_path not in extra_paths:
@@ -397,7 +397,7 @@ class PkgConfigDependency(ExternalDependency):
#
# Only prefix_libpaths are reordered here because there should not be
# too many system_libpaths to cause library version issues.
- pkg_config_path: T.List[str] = self.env.coredata.options[OptionKey('pkg_config_path', machine=self.for_machine)].value
+ pkg_config_path: T.List[str] = self.env.coredata.optstore[OptionKey('pkg_config_path', machine=self.for_machine)].value
pkg_config_path = self._convert_mingw_paths(pkg_config_path)
prefix_libpaths = OrderedSet(sort_libpaths(list(prefix_libpaths), pkg_config_path))
system_libpaths: OrderedSet[str] = OrderedSet()
diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py
index a0a22c1..2ec7b9d 100644
--- a/mesonbuild/dependencies/python.py
+++ b/mesonbuild/dependencies/python.py
@@ -296,8 +296,8 @@ class PythonSystemDependency(SystemDependency, _PythonDependencyBase):
# `debugoptimized` buildtype may not set debug=True currently, see gh-11645
is_debug_build = debug or buildtype == 'debug'
vscrt_debug = False
- if mesonlib.OptionKey('b_vscrt') in self.env.coredata.options:
- vscrt = self.env.coredata.options[mesonlib.OptionKey('b_vscrt')].value
+ if mesonlib.OptionKey('b_vscrt') in self.env.coredata.optstore:
+ vscrt = self.env.coredata.optstore[mesonlib.OptionKey('b_vscrt')].value
if vscrt in {'mdd', 'mtd', 'from_buildtype', 'static_from_buildtype'}:
vscrt_debug = True
if is_debug_build and vscrt_debug and not self.variables.get('Py_DEBUG'):
diff --git a/mesonbuild/dependencies/qt.py b/mesonbuild/dependencies/qt.py
index 65b6a58..cc80ce8 100644
--- a/mesonbuild/dependencies/qt.py
+++ b/mesonbuild/dependencies/qt.py
@@ -297,8 +297,8 @@ class QmakeQtDependency(_QtBase, ConfigToolDependency, metaclass=abc.ABCMeta):
# Use the buildtype by default, but look at the b_vscrt option if the
# compiler supports it.
is_debug = self.env.coredata.get_option(mesonlib.OptionKey('buildtype')) == 'debug'
- if mesonlib.OptionKey('b_vscrt') in self.env.coredata.options:
- if self.env.coredata.options[mesonlib.OptionKey('b_vscrt')].value in {'mdd', 'mtd'}:
+ if mesonlib.OptionKey('b_vscrt') in self.env.coredata.optstore:
+ if self.env.coredata.optstore[mesonlib.OptionKey('b_vscrt')].value in {'mdd', 'mtd'}:
is_debug = True
modules_lib_suffix = _get_modules_lib_suffix(self.version, self.env.machines[self.for_machine], is_debug)
diff --git a/mesonbuild/interpreter/compiler.py b/mesonbuild/interpreter/compiler.py
index 359e8e7..1bdb321 100644
--- a/mesonbuild/interpreter/compiler.py
+++ b/mesonbuild/interpreter/compiler.py
@@ -270,7 +270,7 @@ class CompilerHolder(ObjectHolder['Compiler']):
for idir in i.to_string_list(self.environment.get_source_dir(), self.environment.get_build_dir()):
args.extend(self.compiler.get_include_args(idir, False))
if not kwargs['no_builtin_args']:
- opts = coredata.OptionsView(self.environment.coredata.options, self.subproject)
+ opts = coredata.OptionsView(self.environment.coredata.optstore, self.subproject)
args += self.compiler.get_option_compile_args(opts)
if mode is CompileCheckMode.LINK:
args.extend(self.compiler.get_option_link_args(opts))
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 6474e60..a423ed8 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -1013,7 +1013,7 @@ class Interpreter(InterpreterBase, HoldableObject):
kwargs: kwtypes.DoSubproject) -> SubprojectHolder:
from ..cmake import CMakeInterpreter
with mlog.nested(subp_name):
- prefix = self.coredata.options[OptionKey('prefix')].value
+ prefix = self.coredata.optstore[OptionKey('prefix')].value
from ..modules.cmake import CMakeSubprojectOptions
options = kwargs.get('options') or CMakeSubprojectOptions()
@@ -1052,7 +1052,7 @@ class Interpreter(InterpreterBase, HoldableObject):
key = OptionKey.from_string(optname).evolve(subproject=self.subproject)
if not key.is_project():
- for opts in [self.coredata.options, compilers.base_options]:
+ for opts in [self.coredata.optstore, compilers.base_options]:
v = opts.get(key)
if v is None or v.yielding:
v = opts.get(key.as_root())
@@ -1061,9 +1061,9 @@ class Interpreter(InterpreterBase, HoldableObject):
return v
try:
- opt = self.coredata.options[key]
- if opt.yielding and key.subproject and key.as_root() in self.coredata.options:
- popt = self.coredata.options[key.as_root()]
+ opt = self.coredata.optstore[key]
+ if opt.yielding and key.subproject and key.as_root() in self.coredata.optstore:
+ popt = self.coredata.optstore[key.as_root()]
if type(opt) is type(popt):
opt = popt
else:
@@ -1543,7 +1543,7 @@ class Interpreter(InterpreterBase, HoldableObject):
if self.subproject:
options = {}
for k in comp.get_options():
- v = copy.copy(self.coredata.options[k])
+ v = copy.copy(self.coredata.optstore[k])
k = k.evolve(subproject=self.subproject)
options[k] = v
self.coredata.add_compiler_options(options, lang, for_machine, self.environment, self.subproject)
@@ -3041,13 +3041,13 @@ class Interpreter(InterpreterBase, HoldableObject):
break
def check_clang_asan_lundef(self) -> None:
- if OptionKey('b_lundef') not in self.coredata.options:
+ if OptionKey('b_lundef') not in self.coredata.optstore:
return
- if OptionKey('b_sanitize') not in self.coredata.options:
+ if OptionKey('b_sanitize') not in self.coredata.optstore:
return
- if (self.coredata.options[OptionKey('b_lundef')].value and
- self.coredata.options[OptionKey('b_sanitize')].value != 'none'):
- value = self.coredata.options[OptionKey('b_sanitize')].value
+ if (self.coredata.optstore[OptionKey('b_lundef')].value and
+ self.coredata.optstore[OptionKey('b_sanitize')].value != 'none'):
+ value = self.coredata.optstore[OptionKey('b_sanitize')].value
mlog.warning(textwrap.dedent(f'''\
Trying to use {value} sanitizer on Clang with b_lundef.
This will probably not work.
diff --git a/mesonbuild/interpreter/interpreterobjects.py b/mesonbuild/interpreter/interpreterobjects.py
index adec0d5..f5dafa7 100644
--- a/mesonbuild/interpreter/interpreterobjects.py
+++ b/mesonbuild/interpreter/interpreterobjects.py
@@ -90,7 +90,7 @@ class FeatureOptionHolder(ObjectHolder[options.UserFeatureOption]):
super().__init__(option, interpreter)
if option and option.is_auto():
# TODO: we need to cast here because options is not a TypedDict
- auto = T.cast('options.UserFeatureOption', self.env.coredata.options[OptionKey('auto_features')])
+ auto = T.cast('options.UserFeatureOption', self.env.coredata.optstore[OptionKey('auto_features')])
self.held_object = copy.copy(auto)
self.held_object.name = option.name
self.methods.update({'enabled': self.enabled_method,
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py
index 48359de..0ed7c92 100644
--- a/mesonbuild/mconf.py
+++ b/mesonbuild/mconf.py
@@ -229,11 +229,11 @@ class Conf:
return
if title:
self.add_title(title)
- auto = T.cast('options.UserFeatureOption', self.coredata.options[OptionKey('auto_features')])
+ auto = T.cast('options.UserFeatureOption', self.coredata.optstore[OptionKey('auto_features')])
for k, o in sorted(opts.items()):
printable_value = o.printable_value()
root = k.as_root()
- if o.yielding and k.subproject and root in self.coredata.options:
+ if o.yielding and k.subproject and root in self.coredata.optstore:
printable_value = '<inherited from main project>'
if isinstance(o, options.UserFeatureOption) and o.is_auto():
printable_value = auto.printable_value()
@@ -264,7 +264,7 @@ class Conf:
test_options: 'coredata.MutableKeyedOptionDictType' = {}
core_options: 'coredata.MutableKeyedOptionDictType' = {}
module_options: T.Dict[str, 'coredata.MutableKeyedOptionDictType'] = collections.defaultdict(dict)
- for k, v in self.coredata.options.items():
+ for k, v in self.coredata.optstore.items():
if k in dir_option_names:
dir_options[k] = v
elif k in test_option_names:
@@ -280,17 +280,17 @@ class Conf:
host_core_options = self.split_options_per_subproject({k: v for k, v in core_options.items() if k.machine is MachineChoice.HOST})
build_core_options = self.split_options_per_subproject({k: v for k, v in core_options.items() if k.machine is MachineChoice.BUILD})
- host_compiler_options = self.split_options_per_subproject({k: v for k, v in self.coredata.options.items() if k.is_compiler() and k.machine is MachineChoice.HOST})
- build_compiler_options = self.split_options_per_subproject({k: v for k, v in self.coredata.options.items() if k.is_compiler() and k.machine is MachineChoice.BUILD})
- project_options = self.split_options_per_subproject({k: v for k, v in self.coredata.options.items() if k.is_project()})
+ host_compiler_options = self.split_options_per_subproject({k: v for k, v in self.coredata.optstore.items() if k.is_compiler() and k.machine is MachineChoice.HOST})
+ build_compiler_options = self.split_options_per_subproject({k: v for k, v in self.coredata.optstore.items() if k.is_compiler() and k.machine is MachineChoice.BUILD})
+ project_options = self.split_options_per_subproject({k: v for k, v in self.coredata.optstore.items() if k.is_project()})
show_build_options = self.default_values_only or self.build.environment.is_cross_build()
self.add_section('Main project options')
self.print_options('Core options', host_core_options[''])
if show_build_options:
self.print_options('', build_core_options[''])
- self.print_options('Backend options', {k: v for k, v in self.coredata.options.items() if k.is_backend()})
- self.print_options('Base options', {k: v for k, v in self.coredata.options.items() if k.is_base()})
+ 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('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 c678cf7..b13af54 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -291,7 +291,7 @@ def list_buildoptions(coredata: cdata.CoreData, subprojects: T.Optional[T.List[s
dir_options: 'cdata.MutableKeyedOptionDictType' = {}
test_options: 'cdata.MutableKeyedOptionDictType' = {}
core_options: 'cdata.MutableKeyedOptionDictType' = {}
- for k, v in coredata.options.items():
+ for k, v in coredata.optstore.items():
if k in dir_option_names:
dir_options[k] = v
elif k in test_option_names:
@@ -326,14 +326,14 @@ def list_buildoptions(coredata: cdata.CoreData, subprojects: T.Optional[T.List[s
optlist.append(optdict)
add_keys(core_options, 'core')
- add_keys({k: v for k, v in coredata.options.items() if k.is_backend()}, 'backend')
- add_keys({k: v for k, v in coredata.options.items() if k.is_base()}, 'base')
+ 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 sorted(coredata.options.items(), key=lambda i: i[0].machine) if k.is_compiler()},
+ {k: v for k, v in sorted(coredata.optstore.items(), key=lambda i: i[0].machine) if k.is_compiler()},
'compiler',
)
add_keys(dir_options, 'directory')
- add_keys({k: v for k, v in coredata.options.items() if k.is_project()}, 'user')
+ add_keys({k: v for k, v in coredata.optstore.items() if k.is_project()}, 'user')
add_keys(test_options, 'test')
return optlist
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 4405c40..f46e4f5 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -906,7 +906,7 @@ class GnomeModule(ExtensionModule):
if state.project_args.get(lang):
cflags += state.project_args[lang]
if mesonlib.OptionKey('b_sanitize') in compiler.base_options:
- sanitize = state.environment.coredata.options[mesonlib.OptionKey('b_sanitize')].value
+ sanitize = state.environment.coredata.optstore[mesonlib.OptionKey('b_sanitize')].value
cflags += compiler.sanitizer_compile_args(sanitize)
sanitize = sanitize.split(',')
# These must be first in ldflags
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
index d195a3f..3f7affe 100644
--- a/mesonbuild/modules/python.py
+++ b/mesonbuild/modules/python.py
@@ -205,7 +205,7 @@ class PythonInstallation(_ExternalProgramHolder['PythonExternalProgram']):
new_link_args = mesonlib.extract_as_list(kwargs, 'link_args')
- is_debug = self.interpreter.environment.coredata.options[OptionKey('debug')].value
+ is_debug = self.interpreter.environment.coredata.optstore[OptionKey('debug')].value
if is_debug:
new_link_args.append(python_windows_debug_link_exception)
else:
diff --git a/mesonbuild/modules/rust.py b/mesonbuild/modules/rust.py
index 8534dfa..a8e2254 100644
--- a/mesonbuild/modules/rust.py
+++ b/mesonbuild/modules/rust.py
@@ -231,7 +231,7 @@ class RustModule(ExtensionModule):
# bindgen always uses clang, so it's safe to hardcode -I here
clang_args.extend([f'-I{x}' for x in i.to_string_list(
state.environment.get_source_dir(), state.environment.get_build_dir())])
- if are_asserts_disabled(state.environment.coredata.options):
+ if are_asserts_disabled(state.environment.coredata.optstore):
clang_args.append('-DNDEBUG')
for de in kwargs['dependencies']:
diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py
index c1d71e2..8f561e4 100644
--- a/mesonbuild/msetup.py
+++ b/mesonbuild/msetup.py
@@ -273,9 +273,9 @@ class MesonApp:
# collect warnings about unsupported build configurations; must be done after full arg processing
# by Interpreter() init, but this is most visible at the end
- if env.coredata.options[mesonlib.OptionKey('backend')].value == 'xcode':
+ if env.coredata.optstore[mesonlib.OptionKey('backend')].value == 'xcode':
mlog.warning('xcode backend is currently unmaintained, patches welcome')
- if env.coredata.options[mesonlib.OptionKey('layout')].value == 'flat':
+ if env.coredata.optstore[mesonlib.OptionKey('layout')].value == 'flat':
mlog.warning('-Dlayout=flat is unsupported and probably broken. It was a failed experiment at '
'making Windows build artifacts runnable while uninstalled, due to PATH considerations, '
'but was untested by CI and anyways breaks reasonable use of conflicting targets in different subdirs. '
diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py
index 0a40a71..78517bf 100644
--- a/mesonbuild/rewriter.py
+++ b/mesonbuild/rewriter.py
@@ -470,11 +470,11 @@ class Rewriter:
cdata = self.interpreter.coredata
options = {
- **{str(k): v for k, v in cdata.options.items()},
- **{str(k): v for k, v in cdata.options.items()},
- **{str(k): v for k, v in cdata.options.items()},
- **{str(k): v for k, v in cdata.options.items()},
- **{str(k): v for k, v in cdata.options.items()},
+ **{str(k): v for k, v in cdata.optstore.items()},
+ **{str(k): v for k, v in cdata.optstore.items()},
+ **{str(k): v for k, v in cdata.optstore.items()},
+ **{str(k): v for k, v in cdata.optstore.items()},
+ **{str(k): v for k, v in cdata.optstore.items()},
}
for key, val in sorted(cmd['options'].items()):
diff --git a/run_tests.py b/run_tests.py
index 63eb62c..5b229d7 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -151,7 +151,7 @@ def get_fake_env(sdir='', bdir=None, prefix='', opts=None):
if opts is None:
opts = get_fake_options(prefix)
env = Environment(sdir, bdir, opts)
- env.coredata.options[OptionKey('args', lang='c')] = FakeCompilerOptions()
+ env.coredata.optstore[OptionKey('args', lang='c')] = FakeCompilerOptions()
env.machines.host.cpu_family = 'x86_64' # Used on macOS inside find_library
# Invalidate cache when using a different Environment object.
clear_meson_configure_class_caches()
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index 63445ec..042f210 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -2621,35 +2621,35 @@ class AllPlatformTests(BasePlatformTests):
out = self.init(testdir, extra_args=['--profile-self', '--fatal-meson-warnings'])
self.assertNotIn('[default: true]', out)
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('default_library')].value, 'static')
- self.assertEqual(obj.options[OptionKey('warning_level')].value, '1')
- self.assertEqual(obj.options[OptionKey('set_sub_opt')].value, True)
- self.assertEqual(obj.options[OptionKey('subp_opt', 'subp')].value, 'default3')
+ self.assertEqual(obj.optstore[OptionKey('default_library')].value, 'static')
+ self.assertEqual(obj.optstore[OptionKey('warning_level')].value, '1')
+ self.assertEqual(obj.optstore[OptionKey('set_sub_opt')].value, True)
+ self.assertEqual(obj.optstore[OptionKey('subp_opt', 'subp')].value, 'default3')
self.wipe()
# warning_level is special, it's --warnlevel instead of --warning-level
# for historical reasons
self.init(testdir, extra_args=['--warnlevel=2', '--fatal-meson-warnings'])
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('warning_level')].value, '2')
+ self.assertEqual(obj.optstore[OptionKey('warning_level')].value, '2')
self.setconf('--warnlevel=3')
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('warning_level')].value, '3')
+ self.assertEqual(obj.optstore[OptionKey('warning_level')].value, '3')
self.setconf('--warnlevel=everything')
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('warning_level')].value, 'everything')
+ self.assertEqual(obj.optstore[OptionKey('warning_level')].value, 'everything')
self.wipe()
# But when using -D syntax, it should be 'warning_level'
self.init(testdir, extra_args=['-Dwarning_level=2', '--fatal-meson-warnings'])
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('warning_level')].value, '2')
+ self.assertEqual(obj.optstore[OptionKey('warning_level')].value, '2')
self.setconf('-Dwarning_level=3')
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('warning_level')].value, '3')
+ self.assertEqual(obj.optstore[OptionKey('warning_level')].value, '3')
self.setconf('-Dwarning_level=everything')
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('warning_level')].value, 'everything')
+ self.assertEqual(obj.optstore[OptionKey('warning_level')].value, 'everything')
self.wipe()
# Mixing --option and -Doption is forbidden
@@ -2673,15 +2673,15 @@ class AllPlatformTests(BasePlatformTests):
# --default-library should override default value from project()
self.init(testdir, extra_args=['--default-library=both', '--fatal-meson-warnings'])
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('default_library')].value, 'both')
+ self.assertEqual(obj.optstore[OptionKey('default_library')].value, 'both')
self.setconf('--default-library=shared')
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('default_library')].value, 'shared')
+ self.assertEqual(obj.optstore[OptionKey('default_library')].value, 'shared')
if self.backend is Backend.ninja:
# reconfigure target works only with ninja backend
self.build('reconfigure')
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('default_library')].value, 'shared')
+ self.assertEqual(obj.optstore[OptionKey('default_library')].value, 'shared')
self.wipe()
# Should fail on unknown options
@@ -2718,22 +2718,22 @@ class AllPlatformTests(BasePlatformTests):
# Test we can set subproject option
self.init(testdir, extra_args=['-Dsubp:subp_opt=foo', '--fatal-meson-warnings'])
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('subp_opt', 'subp')].value, 'foo')
+ self.assertEqual(obj.optstore[OptionKey('subp_opt', 'subp')].value, 'foo')
self.wipe()
# c_args value should be parsed with split_args
self.init(testdir, extra_args=['-Dc_args=-Dfoo -Dbar "-Dthird=one two"', '--fatal-meson-warnings'])
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('args', lang='c')].value, ['-Dfoo', '-Dbar', '-Dthird=one two'])
+ self.assertEqual(obj.optstore[OptionKey('args', lang='c')].value, ['-Dfoo', '-Dbar', '-Dthird=one two'])
self.setconf('-Dc_args="foo bar" one two')
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('args', lang='c')].value, ['foo bar', 'one', 'two'])
+ self.assertEqual(obj.optstore[OptionKey('args', lang='c')].value, ['foo bar', 'one', 'two'])
self.wipe()
self.init(testdir, extra_args=['-Dset_percent_opt=myoption%', '--fatal-meson-warnings'])
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('set_percent_opt')].value, 'myoption%')
+ self.assertEqual(obj.optstore[OptionKey('set_percent_opt')].value, 'myoption%')
self.wipe()
# Setting a 2nd time the same option should override the first value
@@ -2744,19 +2744,19 @@ class AllPlatformTests(BasePlatformTests):
'-Dc_args=-Dfoo', '-Dc_args=-Dbar',
'-Db_lundef=false', '--fatal-meson-warnings'])
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('bindir')].value, 'bar')
- self.assertEqual(obj.options[OptionKey('buildtype')].value, 'release')
- self.assertEqual(obj.options[OptionKey('b_sanitize')].value, 'thread')
- self.assertEqual(obj.options[OptionKey('args', lang='c')].value, ['-Dbar'])
+ self.assertEqual(obj.optstore[OptionKey('bindir')].value, 'bar')
+ self.assertEqual(obj.optstore[OptionKey('buildtype')].value, 'release')
+ self.assertEqual(obj.optstore[OptionKey('b_sanitize')].value, 'thread')
+ self.assertEqual(obj.optstore[OptionKey('args', lang='c')].value, ['-Dbar'])
self.setconf(['--bindir=bar', '--bindir=foo',
'-Dbuildtype=release', '-Dbuildtype=plain',
'-Db_sanitize=thread', '-Db_sanitize=address',
'-Dc_args=-Dbar', '-Dc_args=-Dfoo'])
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('bindir')].value, 'foo')
- self.assertEqual(obj.options[OptionKey('buildtype')].value, 'plain')
- self.assertEqual(obj.options[OptionKey('b_sanitize')].value, 'address')
- self.assertEqual(obj.options[OptionKey('args', lang='c')].value, ['-Dfoo'])
+ self.assertEqual(obj.optstore[OptionKey('bindir')].value, 'foo')
+ self.assertEqual(obj.optstore[OptionKey('buildtype')].value, 'plain')
+ self.assertEqual(obj.optstore[OptionKey('b_sanitize')].value, 'address')
+ self.assertEqual(obj.optstore[OptionKey('args', lang='c')].value, ['-Dfoo'])
self.wipe()
except KeyError:
# Ignore KeyError, it happens on CI for compilers that does not
@@ -2770,25 +2770,25 @@ class AllPlatformTests(BasePlatformTests):
# Verify default values when passing no args
self.init(testdir)
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('warning_level')].value, '0')
+ self.assertEqual(obj.optstore[OptionKey('warning_level')].value, '0')
self.wipe()
# verify we can override w/ --warnlevel
self.init(testdir, extra_args=['--warnlevel=1'])
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('warning_level')].value, '1')
+ self.assertEqual(obj.optstore[OptionKey('warning_level')].value, '1')
self.setconf('--warnlevel=0')
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('warning_level')].value, '0')
+ self.assertEqual(obj.optstore[OptionKey('warning_level')].value, '0')
self.wipe()
# verify we can override w/ -Dwarning_level
self.init(testdir, extra_args=['-Dwarning_level=1'])
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('warning_level')].value, '1')
+ self.assertEqual(obj.optstore[OptionKey('warning_level')].value, '1')
self.setconf('-Dwarning_level=0')
obj = mesonbuild.coredata.load(self.builddir)
- self.assertEqual(obj.options[OptionKey('warning_level')].value, '0')
+ self.assertEqual(obj.optstore[OptionKey('warning_level')].value, '0')
self.wipe()
def test_feature_check_usage_subprojects(self):
diff --git a/unittests/datatests.py b/unittests/datatests.py
index 19664e3..b596446 100644
--- a/unittests/datatests.py
+++ b/unittests/datatests.py
@@ -163,9 +163,9 @@ class DataTests(unittest.TestCase):
else:
raise RuntimeError(f'Invalid debug value {debug!r} in row:\n{m.group()}')
env.coredata.set_option(OptionKey('buildtype'), buildtype)
- self.assertEqual(env.coredata.options[OptionKey('buildtype')].value, buildtype)
- self.assertEqual(env.coredata.options[OptionKey('optimization')].value, opt)
- self.assertEqual(env.coredata.options[OptionKey('debug')].value, debug)
+ self.assertEqual(env.coredata.optstore[OptionKey('buildtype')].value, buildtype)
+ self.assertEqual(env.coredata.optstore[OptionKey('optimization')].value, opt)
+ self.assertEqual(env.coredata.optstore[OptionKey('debug')].value, debug)
def test_cpu_families_documented(self):
with open("docs/markdown/Reference-tables.md", encoding='utf-8') as f:
diff --git a/unittests/internaltests.py b/unittests/internaltests.py
index 411c97b..42cc41e 100644
--- a/unittests/internaltests.py
+++ b/unittests/internaltests.py
@@ -625,7 +625,7 @@ class InternalTests(unittest.TestCase):
env = get_fake_env()
compiler = detect_c_compiler(env, MachineChoice.HOST)
env.coredata.compilers.host = {'c': compiler}
- env.coredata.options[OptionKey('link_args', lang='c')] = FakeCompilerOptions()
+ env.coredata.optstore[OptionKey('link_args', lang='c')] = FakeCompilerOptions()
p1 = Path(tmpdir) / '1'
p2 = Path(tmpdir) / '2'
p1.mkdir()
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py
index bfe3586..1e8038f 100644
--- a/unittests/linuxliketests.py
+++ b/unittests/linuxliketests.py
@@ -1124,7 +1124,7 @@ class LinuxlikeTests(BasePlatformTests):
# option, adding the meson-uninstalled directory to it.
PkgConfigInterface.setup_env({}, env, MachineChoice.HOST, uninstalled=True)
- pkg_config_path = env.coredata.options[OptionKey('pkg_config_path')].value
+ pkg_config_path = env.coredata.optstore[OptionKey('pkg_config_path')].value
self.assertEqual(pkg_config_path, [pkg_dir])
@skipIfNoPkgconfig