aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/minstall.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-01-15 23:08:47 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2022-01-16 23:42:19 +0530
commit1cda222a1a5faf98bf5c72bc103307bf76f76f7f (patch)
tree5d3a42d417c22b9a25e97092e5194abefa50a518 /mesonbuild/minstall.py
parentd9dee508aeff766bcbf81a7151a0c0f585e12ee4 (diff)
downloadmeson-1cda222a1a5faf98bf5c72bc103307bf76f76f7f.zip
meson-1cda222a1a5faf98bf5c72bc103307bf76f76f7f.tar.gz
meson-1cda222a1a5faf98bf5c72bc103307bf76f76f7f.tar.bz2
install: Setup VS env if we did that during setup
Otherwise we might not find a ninja that was picked up from the Visual Studio installation. ``` $ meson setup _build ... Activating VS 15.9.40 ... Found ninja-1.8.2 at "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.EXE" $ meson compile -C _build Activating VS 15.9.40 ... $ meson install -C _build Can't find ninja, can't rebuild test. ``` Fixes https://github.com/mesonbuild/meson/issues/9774
Diffstat (limited to 'mesonbuild/minstall.py')
-rw-r--r--mesonbuild/minstall.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
index af847f7..47ebb75 100644
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -25,6 +25,7 @@ import subprocess
import sys
import typing as T
+from . import build
from . import environment
from .backend.backends import (
InstallData, InstallDataBase, InstallEmptyDir, InstallSymlinkData,
@@ -32,7 +33,7 @@ from .backend.backends import (
)
from .coredata import major_versions_differ, MesonVersionMismatchException
from .coredata import version as coredata_version
-from .mesonlib import Popen_safe, RealPathAction, is_windows
+from .mesonlib import Popen_safe, RealPathAction, is_windows, setup_vsenv
from .scripts import depfixer, destdir_join
from .scripts.meson_exe import run_exe
try:
@@ -793,6 +794,8 @@ def run(opts: 'ArgumentType') -> int:
if not os.path.exists(os.path.join(opts.wd, datafilename)):
sys.exit('Install data not found. Run this command in build directory root.')
if not opts.no_rebuild:
+ b = build.load(opts.wd)
+ setup_vsenv(b.need_vsenv)
if not rebuild_all(opts.wd):
sys.exit(-1)
os.chdir(opts.wd)