From 3506248450cdb510ff36bec2f24255a5d8d5a11c Mon Sep 17 00:00:00 2001 From: DFOVIT <71126069+DFOVIT@users.noreply.github.com> Date: Fri, 7 Jan 2022 12:24:17 +0100 Subject: [PATCH] Search for Visual Studio Express when activating VS env Visual Studio Express does not come with the 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' workload. This adds a check for the 'Microsoft.VisualStudio.Workload.WDExpress' workload. Non-express versions take precedence over express versions when activating. --- mesonbuild/mesonlib/vsenv.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mesonbuild/mesonlib/vsenv.py b/mesonbuild/mesonlib/vsenv.py index 2ba2b90bb..8563b7ddd 100644 --- a/mesonbuild/mesonlib/vsenv.py +++ b/mesonbuild/mesonlib/vsenv.py @@ -56,6 +56,7 @@ def _setup_vsenv(force: bool) -> bool: '-prerelease', '-requiresAny', '-requires', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', + '-requires', 'Microsoft.VisualStudio.Workload.WDExpress', '-products', '*', '-utf8', '-format', @@ -71,6 +72,9 @@ def _setup_vsenv(force: bool) -> bool: bat_path = bat_root / 'VC/Auxiliary/Build/vcvarsx86_arm64.bat' else: bat_path = bat_root / 'VC/Auxiliary/Build/vcvars64.bat' + # if VS is not found try VS Express + if not bat_path.exists(): + bat_path = bat_root / 'VC/Auxiliary/Build/vcvarsx86_amd64.bat' if not bat_path.exists(): raise MesonException(f'Could not find {bat_path}')