diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-12-30 23:22:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-30 23:22:01 +0200 |
commit | a9c57e17a9389eb057e2857eb21c430d67d43e09 (patch) | |
tree | 04b31267a3d083e073ec28e85fc398eaee472be4 | |
parent | 4f32d11e1b975cd37050995c1ec89ebb94a24eaa (diff) | |
parent | 2fc3fc8d672e83d67ec7372ad3eccc8717eb7124 (diff) | |
download | meson-a9c57e17a9389eb057e2857eb21c430d67d43e09.zip meson-a9c57e17a9389eb057e2857eb21c430d67d43e09.tar.gz meson-a9c57e17a9389eb057e2857eb21c430d67d43e09.tar.bz2 |
Merge pull request #2849 from polarina/vsregenfix
Fix Visual Studio version detection for the `vs` backend
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 7 | ||||
-rw-r--r-- | mesonbuild/mesonmain.py | 1 |
2 files changed, 4 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: diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index f811def..20ec304 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -172,6 +172,7 @@ class MesonApp: elif self.options.backend == 'vs': from .backend import vs2010backend g = vs2010backend.autodetect_vs_version(b) + env.coredata.set_builtin_option('backend', g.name) mlog.log('Auto detected Visual Studio backend:', mlog.bold(g.name)) elif self.options.backend == 'vs2010': from .backend import vs2010backend |