diff options
author | Jacob Nielsen <36698748+Jacob-Nielsen@users.noreply.github.com> | 2021-05-22 00:05:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-22 01:05:18 +0300 |
commit | 3e5ec00a40fa1b0431b82cff950fca9e8f99df89 (patch) | |
tree | c910f41713579605bca6a2bbbc78800398baa2b2 /mesonbuild/mesonmain.py | |
parent | 619e05c8cf889c84fc619a54e8f8dddba228bd0a (diff) | |
download | meson-3e5ec00a40fa1b0431b82cff950fca9e8f99df89.zip meson-3e5ec00a40fa1b0431b82cff950fca9e8f99df89.tar.gz meson-3e5ec00a40fa1b0431b82cff950fca9e8f99df89.tar.bz2 |
Better detection of Visual Studio compiler
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 |