diff --git a/cross/ubuntu-armhf.txt b/cross/ubuntu-armhf.txt index 69e0c8611..aa75cdc59 100644 --- a/cross/ubuntu-armhf.txt +++ b/cross/ubuntu-armhf.txt @@ -14,6 +14,9 @@ ld = '/usr/bin/arm-linux/gnueabihf-ld' c_args = ['-DMESON_TEST_ISSUE_1665=1'] cpp_args = '-DMESON_TEST_ISSUE_1665=1' +[zlib:built-in options] +c_std = 'c99' + [properties] root = '/usr/arm-linux-gnueabihf' diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 3a198e969..cb05b1d99 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -783,6 +783,21 @@ class Environment: self.wrap_resolver = None self.overrides = OptionOverrides() self.init_overrides() + self.check_dual_overrides() + + def has_per_subproject_options(self): + for o in self.options: + if o.subproject: + return True + return False + + def check_dual_overrides(self): + if self.has_per_subproject_options() and self.coredata.options[mesonlib.OptionKey('override_file')].value: + raise MesonException('''Tried to define a per-subproject option in a machine file when override_file was defined. +This is not supported. All per-subproject options should be transitioned to +use the override file. Machine file overrides are deprecatd and will be +removed in a future Meson release.''') + 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.""" @@ -814,6 +829,8 @@ class Environment: subproject, section = section.split(':') else: subproject = '' + if subproject != '': + mlog.deprecation('Per-subproject option values in machine files are deprecated, transition to using an override_file instead.') if section == 'built-in options': for k, v in values.items(): key = OptionKey.from_string(k) diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py index b34894876..26d213458 100644 --- a/mesonbuild/msetup.py +++ b/mesonbuild/msetup.py @@ -224,6 +224,7 @@ class MesonApp: except Exception as e: mintro.write_meson_info_file(b, [e]) raise + env.check_dual_overrides() # Print all default option values that don't match the current value for def_opt_name, def_opt_value, cur_opt_value in intr.get_non_matching_default_options(): mlog.log('Option', mlog.bold(def_opt_name), 'is:',