diff options
author | GabrĂel ArthĂșr PĂ©tursson <gabriel@system.is> | 2017-12-30 12:38:53 +0000 |
---|---|---|
committer | GabrĂel ArthĂșr PĂ©tursson <gabriel@system.is> | 2017-12-30 13:58:38 +0000 |
commit | c8355c9ffa571c87a250adf6fe2054e8d4ddac53 (patch) | |
tree | 9549ade3f702db2bd28ca5d914f497e6d5de2bf4 | |
parent | 8fb7d9261a743637b332b71355bc178262dbd206 (diff) | |
download | meson-c8355c9ffa571c87a250adf6fe2054e8d4ddac53.zip meson-c8355c9ffa571c87a250adf6fe2054e8d4ddac53.tar.gz meson-c8355c9ffa571c87a250adf6fe2054e8d4ddac53.tar.bz2 |
Fail Visual Studio version detection if VSINSTALLDIR is not set
The Visual Studio Developer Command Prompt always sets the VSINSTALLDIR
environment variable. If not, we probably have a broken environment and
won't get very far anyway.
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index e872a04..6a587ac 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -29,10 +29,9 @@ from ..environment import Environment def autodetect_vs_version(build): vs_version = os.getenv('VisualStudioVersion', None) vs_install_dir = os.getenv('VSINSTALLDIR', None) - if not vs_version and not vs_install_dir: - raise MesonException('Could not detect Visual Studio: VisualStudioVersion and VSINSTALLDIR are unset!\n' - 'Are we inside a Visual Studio build environment? ' - 'You can also try specifying the exact backend to use.') + if not vs_install_dir: + raise MesonException('Could not detect Visual Studio: Environment variable VSINSTALLDIR is not set!\n' + 'Are you running meson from the Visual Studio Developer Command Prompt?') # VisualStudioVersion is set since Visual Studio 12.0, but sometimes # vcvarsall.bat doesn't set it, so also use VSINSTALLDIR if vs_version == '14.0' or 'Visual Studio 14' in vs_install_dir: |