aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/coredata.py
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-02-26 00:55:43 -0500
committerDylan Baker <dylan@pnwbakers.com>2019-02-27 13:10:16 -0800
commit2d6d242aec2305cf60b4b743cdcc6de5b5d9d8ac (patch)
tree41806be9c0118b84f3d4972707f7ee898d4689b0 /mesonbuild/coredata.py
parentc2db7a9ceed3286683967768e6fcc1c170c24c42 (diff)
downloadmeson-2d6d242aec2305cf60b4b743cdcc6de5b5d9d8ac.zip
meson-2d6d242aec2305cf60b4b743cdcc6de5b5d9d8ac.tar.gz
meson-2d6d242aec2305cf60b4b743cdcc6de5b5d9d8ac.tar.bz2
Feed compiler Properties to get its options defaulted
Before, the logic initialization compiler options from environment variables vs config files was strewn about. Now, it is consolidated. We leverage the new `envconfig.py` module to expose the configuration data to `compilers.py` without creating an import cycle.
Diffstat (limited to 'mesonbuild/coredata.py')
-rw-r--r--mesonbuild/coredata.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index 0e11f5c..28e78e5 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -569,13 +569,13 @@ class CoreData:
self.cross_compilers[lang] = cross_comp
# Native compiler always exist so always add its options.
- new_options_for_build = comp.get_options()
+ new_options_for_build = comp.get_and_default_options(env.properties.build)
preproc_flags_for_build = comp.get_preproc_flags()
if cross_comp is not None:
- new_options_for_host = cross_comp.get_options()
+ new_options_for_host = cross_comp.get_and_default_options(env.properties.host)
preproc_flags_for_host = cross_comp.get_preproc_flags()
else:
- new_options_for_host = comp.get_options()
+ new_options_for_host = comp.get_and_default_options(env.properties.host)
preproc_flags_for_host = comp.get_preproc_flags()
opts_machines_list = [
@@ -588,9 +588,6 @@ class CoreData:
for k, o in new_options.items():
if not k.startswith(optprefix):
raise MesonException('Internal error, %s has incorrect prefix.' % k)
- if k in env.properties[for_machine]:
- # Get from configuration files.
- o.set_value(env.properties[for_machine][k])
if (env.machines.matches_build_machine(for_machine) and
k in env.cmd_line_options):
# TODO think about cross and command-line interface.