Skip to content

Commit 9e270f0

Browse files
bruchar1dcbaker
authored andcommitted
Fix detection of unknown base options in subproj
cc4cfbc added detection for unknown base options, but it was not working for subproject base options. This should fix it.
1 parent 0cd74c9 commit 9e270f0

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

mesonbuild/coredata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ def set_default_options(self, default_options: T.MutableMapping[OptionKey, str],
10091009
# adding languages and setting backend.
10101010
if k.type in {OptionType.COMPILER, OptionType.BACKEND}:
10111011
continue
1012-
if k.type == OptionType.BASE and k in base_options:
1012+
if k.type == OptionType.BASE and k.as_root() in base_options:
10131013
# set_options will report unknown base options
10141014
continue
10151015
options[k] = v
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
project('reconfigure', 'c',
22
default_options: ['c_std=c89'])
33

4+
subproject('sub')
5+
46
message('b_ndebug: ' + get_option('b_ndebug'))
57
message('c_std: ' + get_option('c_std'))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
project('sub', 'c',
2+
default_options: ['c_std=c89'])
3+
4+
message('b_ndebug: ' + get_option('b_ndebug'))
5+
message('c_std: ' + get_option('c_std'))

unittests/platformagnostictests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def test_reconfigure_base_options(self):
282282
self.assertIn('\nMessage: b_ndebug: true\n', out)
283283
self.assertIn('\nMessage: c_std: c89\n', out)
284284

285-
out = self.init(testdir, extra_args=['--reconfigure', '-Db_ndebug=if-release', '-Dc_std=c99'])
285+
out = self.init(testdir, extra_args=['--reconfigure', '-Db_ndebug=if-release', '-Dsub:b_ndebug=false', '-Dc_std=c99'])
286286
self.assertIn('\nMessage: b_ndebug: if-release\n', out)
287287
self.assertIn('\nMessage: c_std: c99\n', out)
288288

0 commit comments

Comments
 (0)