aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreter.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-03-23 08:29:24 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2023-03-28 00:36:37 +0300
commit567d1fec9b6f2191535509a5eae29436a024bd70 (patch)
tree3472142a33a8e9a1cd132ffbad5953524e966cc3 /mesonbuild/interpreter/interpreter.py
parent03498424d0bacab75f19c335ffdaa4efd8d512ed (diff)
downloadmeson-567d1fec9b6f2191535509a5eae29436a024bd70.zip
meson-567d1fec9b6f2191535509a5eae29436a024bd70.tar.gz
meson-567d1fec9b6f2191535509a5eae29436a024bd70.tar.bz2
Make backend option read-only
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r--mesonbuild/interpreter/interpreter.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 4c3f723..a033c4f 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -1136,7 +1136,9 @@ class Interpreter(InterpreterBase, HoldableObject):
if backend != self.backend.name:
if self.backend.name.startswith('vs'):
mlog.log('Auto detected Visual Studio backend:', mlog.bold(self.backend.name))
- self.coredata.set_option(OptionKey('backend'), self.backend.name)
+ if not self.environment.first_invocation:
+ raise MesonBugException(f'Backend changed from {backend} to {self.backend.name}')
+ self.coredata.set_option(OptionKey('backend'), self.backend.name, first_invocation=True)
# Only init backend options on first invocation otherwise it would
# override values previously set from command line.