aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorJohn Preston <johnprestonmail@gmail.com>2018-11-28 18:22:28 +0400
committerJussi Pakkanen <jpakkane@gmail.com>2018-12-04 20:19:19 +0200
commitc17a80f47b772d759aeb0878aa767a768a6fdd0c (patch)
tree568b959bd2023617f38752fe33d506cc99a62366 /mesonbuild/environment.py
parent8612f1543f280342fcbff69863b8401319fccc7d (diff)
downloadmeson-c17a80f47b772d759aeb0878aa767a768a6fdd0c.zip
meson-c17a80f47b772d759aeb0878aa767a768a6fdd0c.tar.gz
meson-c17a80f47b772d759aeb0878aa767a768a6fdd0c.tar.bz2
Use correct environment for REGEN in VS backend.
Try to guess which VS Command Prompt was used for the Meson call. If one is chosen invoke it before calling Meson in REGEN command.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 36b66ff..9e25add 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -188,6 +188,9 @@ def detect_windows_arch(compilers):
platform = os.environ.get('BUILD_PLAT', 'x86')
if platform == 'Win32':
return 'x86'
+ elif 'VSCMD_ARG_TGT_ARCH' in os.environ:
+ # On MSVC 2017 'Platform' is not set in VsDevCmd.bat
+ return os.environ['VSCMD_ARG_TGT_ARCH']
else:
# On MSVC 2010 and later 'Platform' is only set when the
# target arch is not 'x86'. It's 'x64' when targeting