diff options
| author | Charles Brunet <charles.brunet@optelgroup.com> | 2024-03-06 07:26:25 -0500 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2024-03-10 13:09:32 -0700 |
| commit | 9e270f030f3016be2a419b698b8062e5ed5373b8 (patch) | |
| tree | 266555b8dcc93fa06e66714572b858ea1848385b | |
| parent | 0cd74c96f1b58fe89ef9565ab40905d04538d7ed (diff) | |
| download | meson-9e270f030f3016be2a419b698b8062e5ed5373b8.tar.gz | |
Fix detection of unknown base options in subproj
cc4cfbcad92945a1629c80664e1eb755c68905dd added detection for unknown
base options, but it was not working for subproject base options. This
should fix it.
| -rw-r--r-- | mesonbuild/coredata.py | 2 | ||||
| -rw-r--r-- | test cases/unit/122 reconfigure base options/meson.build | 2 | ||||
| -rw-r--r-- | test cases/unit/122 reconfigure base options/subprojects/sub/meson.build | 5 | ||||
| -rw-r--r-- | unittests/platformagnostictests.py | 2 |
4 files changed, 9 insertions, 2 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index bb155d033..f2ea87993 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -1009,7 +1009,7 @@ class CoreData: # adding languages and setting backend. if k.type in {OptionType.COMPILER, OptionType.BACKEND}: continue - if k.type == OptionType.BASE and k in base_options: + if k.type == OptionType.BASE and k.as_root() in base_options: # set_options will report unknown base options continue options[k] = v diff --git a/test cases/unit/122 reconfigure base options/meson.build b/test cases/unit/122 reconfigure base options/meson.build index 67e83d1e4..8a13b78b2 100644 --- a/test cases/unit/122 reconfigure base options/meson.build +++ b/test cases/unit/122 reconfigure base options/meson.build @@ -1,5 +1,7 @@ project('reconfigure', 'c', default_options: ['c_std=c89']) +subproject('sub') + message('b_ndebug: ' + get_option('b_ndebug')) message('c_std: ' + get_option('c_std')) diff --git a/test cases/unit/122 reconfigure base options/subprojects/sub/meson.build b/test cases/unit/122 reconfigure base options/subprojects/sub/meson.build new file mode 100644 index 000000000..ba740d1ca --- /dev/null +++ b/test cases/unit/122 reconfigure base options/subprojects/sub/meson.build @@ -0,0 +1,5 @@ +project('sub', 'c', +default_options: ['c_std=c89']) + +message('b_ndebug: ' + get_option('b_ndebug')) +message('c_std: ' + get_option('c_std')) diff --git a/unittests/platformagnostictests.py b/unittests/platformagnostictests.py index 21cb3b945..a6db17341 100644 --- a/unittests/platformagnostictests.py +++ b/unittests/platformagnostictests.py @@ -282,7 +282,7 @@ class PlatformAgnosticTests(BasePlatformTests): self.assertIn('\nMessage: b_ndebug: true\n', out) self.assertIn('\nMessage: c_std: c89\n', out) - out = self.init(testdir, extra_args=['--reconfigure', '-Db_ndebug=if-release', '-Dc_std=c99']) + out = self.init(testdir, extra_args=['--reconfigure', '-Db_ndebug=if-release', '-Dsub:b_ndebug=false', '-Dc_std=c99']) self.assertIn('\nMessage: b_ndebug: if-release\n', out) self.assertIn('\nMessage: c_std: c99\n', out) |
