Fix detection of unknown base options in subproj

cc4cfbcad9 added detection for unknown
base options, but it was not working for subproject base options. This
should fix it.
pull/12957/head
Charles Brunet 9 months ago committed by Dylan Baker
parent 0cd74c96f1
commit 9e270f030f
  1. 2
      mesonbuild/coredata.py
  2. 2
      test cases/unit/122 reconfigure base options/meson.build
  3. 5
      test cases/unit/122 reconfigure base options/subprojects/sub/meson.build
  4. 2
      unittests/platformagnostictests.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

@ -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'))

@ -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'))

@ -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)

Loading…
Cancel
Save