aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mconf.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2020-08-03 10:05:38 -0400
committerXavier Claessens <xclaesse@gmail.com>2020-10-16 17:42:24 -0400
commit7902d2032d45f0f44ffad19362e62b301467c918 (patch)
treeb00d24c55c77c92da522458e5a7038fb01dd9b7d /mesonbuild/mconf.py
parentc3b3dc598e8c417e66792444945f7c803d772e62 (diff)
downloadmeson-7902d2032d45f0f44ffad19362e62b301467c918.zip
meson-7902d2032d45f0f44ffad19362e62b301467c918.tar.gz
meson-7902d2032d45f0f44ffad19362e62b301467c918.tar.bz2
Refactor handling of machine file options
It is much easier to not try to parse options into complicated structures until we actually collected all options: machine files, command line, project()'s default_options, environment.
Diffstat (limited to 'mesonbuild/mconf.py')
-rw-r--r--mesonbuild/mconf.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py
index 0245155..774dc5a 100644
--- a/mesonbuild/mconf.py
+++ b/mesonbuild/mconf.py
@@ -197,19 +197,13 @@ class Conf:
test_options = {k: o for k, o in self.coredata.builtins.items() if k in test_option_names}
core_options = {k: o for k, o in self.coredata.builtins.items() if k in core_option_names}
- def insert_build_prefix(k):
- idx = k.find(':')
- if idx < 0:
- return 'build.' + k
- return k[:idx + 1] + 'build.' + k[idx + 1:]
-
core_options = self.split_options_per_subproject(core_options)
host_compiler_options = self.split_options_per_subproject(
dict(self.coredata.flatten_lang_iterator(
self.coredata.compiler_options.host.items())))
build_compiler_options = self.split_options_per_subproject(
dict(self.coredata.flatten_lang_iterator(
- (insert_build_prefix(k), o)
+ (self.coredata.insert_build_prefix(k), o)
for k, o in self.coredata.compiler_options.build.items())))
project_options = self.split_options_per_subproject(self.coredata.user_options)
show_build_options = self.default_values_only or self.build.environment.is_cross_build()
@@ -218,7 +212,7 @@ class Conf:
self.print_options('Core options', core_options[''])
self.print_options('', self.coredata.builtins_per_machine.host)
if show_build_options:
- self.print_options('', {insert_build_prefix(k): o for k, o in self.coredata.builtins_per_machine.build.items()})
+ self.print_options('', {self.coredata.insert_build_prefix(k): o for k, o in self.coredata.builtins_per_machine.build.items()})
self.print_options('Backend options', self.coredata.backend_options)
self.print_options('Base options', self.coredata.base_options)
self.print_options('Compiler options', host_compiler_options.get('', {}))