summaryrefslogtreecommitdiff
path: root/mesonbuild/mcompile.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-01-19 13:39:51 -0500
committerXavier Claessens <xclaesse@gmail.com>2023-03-29 09:33:41 -0400
commitb30cd5d2d587546eac8b560a8c311a52d69fb53e (patch)
treebd20ed04fbe5f5f63044e84a6f612602914217db /mesonbuild/mcompile.py
parent5dc4fcae34ee3a5a3d47021f8ea8b2c5d3b14ea9 (diff)
downloadmeson-b30cd5d2d587546eac8b560a8c311a52d69fb53e.tar.gz
Make --vsenv a readonly builtin option
We need to remember its value when reconfiguring, but the Build object is not reused, only coredata is. This also makes CLI more consistent by allowing `-Dvsenv=true` syntax. Fixes: #11309
Diffstat (limited to 'mesonbuild/mcompile.py')
-rw-r--r--mesonbuild/mcompile.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/mcompile.py b/mesonbuild/mcompile.py
index 817978407..43c449c0c 100644
--- a/mesonbuild/mcompile.py
+++ b/mesonbuild/mcompile.py
@@ -333,8 +333,8 @@ def run(options: 'argparse.Namespace') -> int:
b = build.load(options.wd)
cdata = b.environment.coredata
- vsenv_active = setup_vsenv(b.need_vsenv)
- if vsenv_active:
+ need_vsenv = T.cast('bool', cdata.get_option(mesonlib.OptionKey('vsenv')))
+ if setup_vsenv(need_vsenv):
mlog.log(mlog.green('INFO:'), 'automatically activated MSVC compiler environment')
cmd = [] # type: T.List[str]