aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-04-15 01:23:10 -0400
committerJohn Ericson <git@JohnEricson.me>2019-06-05 23:05:34 -0400
commitaf2d7af9983a04fa2dd6c073bdc41847a23012c8 (patch)
treeaa84b24acb247df40bc924557f92934e3e3776f3 /mesonbuild/interpreter.py
parent126100b1666bfd75db37a0a9aaeee5dbfd11e53a (diff)
downloadmeson-af2d7af9983a04fa2dd6c073bdc41847a23012c8.zip
meson-af2d7af9983a04fa2dd6c073bdc41847a23012c8.tar.gz
meson-af2d7af9983a04fa2dd6c073bdc41847a23012c8.tar.bz2
Per machine do 'build.' and '' option prefixes
See the docs/ changes for details.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r--mesonbuild/interpreter.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 83fc2f1..a945f70 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -2097,12 +2097,12 @@ class Interpreter(InterpreterBase):
def get_non_matching_default_options(self):
env = self.environment
for def_opt_name, def_opt_value in self.project_default_options.items():
- for option_type in env.coredata.get_all_options():
- for cur_opt_name, cur_opt_value in option_type.items():
- if def_opt_name == cur_opt_name:
- def_opt_value = env.coredata.validate_option_value(def_opt_name, def_opt_value)
- if def_opt_value != cur_opt_value.value:
- yield (def_opt_name, def_opt_value, cur_opt_value)
+ for opts in env.coredata.get_all_options():
+ cur_opt_value = opts.get(def_opt_name)
+ if cur_opt_value is not None:
+ def_opt_value = env.coredata.validate_option_value(def_opt_name, def_opt_value)
+ if def_opt_value != cur_opt_value.value:
+ yield (def_opt_name, def_opt_value, cur_opt_value)
def build_func_dict(self):
self.funcs.update({'add_global_arguments': self.func_add_global_arguments,
@@ -2519,13 +2519,14 @@ external dependencies (including libraries) must go to "dependencies".''')
return self.subprojects[dirname]
def get_option_internal(self, optname):
- for d in chain(
+ for opts in chain(
[self.coredata.base_options, compilers.base_options, self.coredata.builtins],
- self.coredata.get_all_compiler_options()):
- try:
- return d[optname]
- except KeyError:
- pass
+ self.coredata.get_prefixed_options_per_machine(self.coredata.builtins_per_machine),
+ self.coredata.get_prefixed_options_per_machine(self.coredata.compiler_options),
+ ):
+ v = opts.get(optname)
+ if v is not None:
+ return v
raw_optname = optname
if self.is_subproject():