diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2025-02-21 12:45:50 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2025-02-21 12:45:50 +0200 |
commit | 926751d7623a853a94abdc6a22b45dd06fc7820b (patch) | |
tree | 9bc52dcc7f419b70b55d78680818e1bc61605b91 | |
parent | d995cbce0f1e9454fdfe467e47c2423aa5217fd3 (diff) | |
download | meson-bhandling.zip meson-bhandling.tar.gz meson-bhandling.tar.bz2 |
Permit all unknown b_ options.bhandling
Closes #14254.
-rw-r--r-- | mesonbuild/msetup.py | 6 | ||||
-rw-r--r-- | unittests/platformagnostictests.py | 9 |
2 files changed, 10 insertions, 5 deletions
diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py index ac0ea7f..90ef4b5 100644 --- a/mesonbuild/msetup.py +++ b/mesonbuild/msetup.py @@ -204,8 +204,10 @@ class MesonApp: if opt.subproject and opt.subproject not in all_subprojects: continue if coredata.optstore.is_compiler_option(opt): + permitlist.append(opt.name) continue - if opt.name in permitted_unknowns: + # Ditto for base options. + if coredata.optstore.is_base_option(opt): permitlist.append(opt.name) continue keystr = str(opt) @@ -222,7 +224,7 @@ class MesonApp: # support it, this option gets silently swallowed. # So at least print a message about it. optstr = ','.join(permitlist) - mlog.warning(f'Some command line options went unused: {optstr}', fatal=False) + mlog.warning(f'The following command line option(s) were not used: {optstr}', fatal=False) coredata.optstore.clear_pending() diff --git a/unittests/platformagnostictests.py b/unittests/platformagnostictests.py index f787805..0d8180c 100644 --- a/unittests/platformagnostictests.py +++ b/unittests/platformagnostictests.py @@ -415,9 +415,12 @@ class PlatformAgnosticTests(BasePlatformTests): def test_setup_with_unknown_option(self): testdir = os.path.join(self.common_test_dir, '1 trivial') - for option in ('not_an_option', 'b_not_an_option'): - out = self.init(testdir, extra_args=['--wipe', f'-D{option}=1'], allow_fail=True) - self.assertIn(f'ERROR: Unknown options: "{option}"', out) + out = self.init(testdir, extra_args=['--wipe', f'-Dnot_an_option=1'], allow_fail=True) + self.assertIn('ERROR: Unknown options: "not_an_option"', out) + + out = self.init(testdir, extra_args=['--wipe', f'-Db_not_an_option=1']) + self.assertIn('WARNING: The following command line option(s) were not used: b_not_an_option', out) + def test_configure_new_option(self) -> None: """Adding a new option without reconfiguring should work.""" |