aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-02-16 11:06:08 -0800
committerNirbheek Chauhan <nirbheek@centricular.com>2021-02-20 15:38:09 +0530
commit8742cae2d1918fb825aab036c784112ca78a4f89 (patch)
tree027f87083ccd3a5a4cc03d0c811282530dcaabd1
parentebfc57009b0c8985c021c79342fc443e8875ed6e (diff)
downloadmeson-8742cae2d1918fb825aab036c784112ca78a4f89.zip
meson-8742cae2d1918fb825aab036c784112ca78a4f89.tar.gz
meson-8742cae2d1918fb825aab036c784112ca78a4f89.tar.bz2
allow build.b_* options
These continue to be ignored as they always have, but no longer raise an error. Fixes: #8354
-rw-r--r--mesonbuild/mesonlib/universal.py3
-rwxr-xr-xrun_unittests.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py
index 19e329d..1b5b86c 100644
--- a/mesonbuild/mesonlib/universal.py
+++ b/mesonbuild/mesonlib/universal.py
@@ -1910,7 +1910,6 @@ def _classify_argument(key: 'OptionKey') -> OptionType:
"""Classify arguments into groups so we know which dict to assign them to."""
if key.name.startswith('b_'):
- assert key.machine is MachineChoice.HOST, str(key)
return OptionType.BASE
elif key.lang is not None:
return OptionType.COMPILER
@@ -2029,7 +2028,7 @@ class OptionKey:
subproject, raw2 = '', raw
if raw2.startswith('build.'):
- raw3 = raw2.lstrip('build.')
+ raw3 = raw2.split('.', 1)[1]
for_machine = MachineChoice.BUILD
else:
raw3 = raw2
diff --git a/run_unittests.py b/run_unittests.py
index 969dc0d..b569108 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -5491,6 +5491,11 @@ class AllPlatformTests(BasePlatformTests):
self.init(srcdir, override_envvars=envs)
self.build()
+ def test_build_b_options(self) -> None:
+ # Currently (0.57) these do nothing, but they've always been allowed
+ srcdir = os.path.join(self.common_test_dir, '2 cpp')
+ self.init(srcdir, extra_args=['-Dbuild.b_lto=true'])
+
class FailureTests(BasePlatformTests):
'''