diff options
Diffstat (limited to 'mesonbuild/mesonlib/vsenv.py')
-rw-r--r-- | mesonbuild/mesonlib/vsenv.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/mesonbuild/mesonlib/vsenv.py b/mesonbuild/mesonlib/vsenv.py index 8563b7d..fcb0c42 100644 --- a/mesonbuild/mesonlib/vsenv.py +++ b/mesonbuild/mesonlib/vsenv.py @@ -26,15 +26,16 @@ def _setup_vsenv(force: bool) -> bool: return False if os.environ.get('OSTYPE') == 'cygwin': return False - if 'Visual Studio' in os.environ['PATH']: - return False - # VSINSTALL is set when running setvars from a Visual Studio installation - # Tested with Visual Studio 2012 and 2017 - if 'VSINSTALLDIR' in os.environ: - return False - # Check explicitly for cl when on Windows - if shutil.which('cl.exe'): - return False + if 'MESON_FORCE_VSENV_FOR_UNITTEST' not in os.environ: + if 'Visual Studio' in os.environ['PATH']: + return False + # VSINSTALL is set when running setvars from a Visual Studio installation + # Tested with Visual Studio 2012 and 2017 + if 'VSINSTALLDIR' in os.environ: + return False + # Check explicitly for cl when on Windows + if shutil.which('cl.exe'): + return False if not force: if shutil.which('cc'): return False |