diff options
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r-- | mesonbuild/mesonmain.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index 4031b0a..ce59ba4 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -54,6 +54,14 @@ def setup_vsenv(): return if 'Visual Studio' in os.environ['PATH']: return + # VSINSTALL is set when running setvars from a Visual Studio installation + # Tested with Visual Studio 2012 and 2017 + if 'VSINSTALLDIR' in os.environ: + return + # Check explicitly for cl when on Windows + if shutil.which('cl.exe'): + return + bat_locator_bin = r'c:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' if not os.path.exists(bat_locator_bin): return |