aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-04-05 10:07:25 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-04-06 16:09:13 -0700
commit111070bf4971d7e404fa642d03be27429e76dce9 (patch)
tree3e91da60d649a61307ea60adf86aa0a0a98f31bb /mesonbuild/environment.py
parentb58e7d84782c08d80692612780806b42af4364e6 (diff)
downloadmeson-111070bf4971d7e404fa642d03be27429e76dce9.zip
meson-111070bf4971d7e404fa642d03be27429e76dce9.tar.gz
meson-111070bf4971d7e404fa642d03be27429e76dce9.tar.bz2
environment: Add some comments to the _load_machine_file_options method
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 32b3d8f..a38ac5d 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -749,12 +749,20 @@ class Environment:
def _load_machine_file_options(self, config: 'ConfigParser', properties: Properties, machine: MachineChoice) -> None:
"""Read the contents of a Machine file and put it in the options store."""
+
+ # Look for any options in the deprecated paths section, warn about
+ # those, then assign them. They will be overwritten by the ones in the
+ # "built-in options" section if they're in both sections.
paths = config.get('paths')
if paths:
mlog.deprecation('The [paths] section is deprecated, use the [built-in options] section instead.')
for k, v in paths.items():
self.options[OptionKey.from_string(k).evolve(machine=machine)] = v
- deprecated_properties = set()
+
+ # Next look for compiler options in the "properties" section, this is
+ # also deprecated, and these will also be overwritten by the "built-in
+ # options" section. We need to remove these from this section, as well.
+ deprecated_properties: T.Set[str] = set()
for lang in compilers.all_languages:
deprecated_properties.add(lang + '_args')
deprecated_properties.add(lang + '_link_args')
@@ -763,6 +771,7 @@ class Environment:
mlog.deprecation(f'{k} in the [properties] section of the machine file is deprecated, use the [built-in options] section.')
self.options[OptionKey.from_string(k).evolve(machine=machine)] = v
del properties.properties[k]
+
for section, values in config.items():
if ':' in section:
subproject, section = section.split(':')
@@ -779,7 +788,7 @@ class Environment:
self.options[key.evolve(subproject=subproject, machine=machine)] = v
elif section == 'project options':
for k, v in values.items():
- # Project options are always for the machine machine
+ # Project options are always for the host machine
key = OptionKey.from_string(k)
if key.subproject:
raise MesonException('Do not set subproject options in [built-in options] section, use [subproject:built-in options] instead.')