Require Visual Studio 2022

https://github.com/actions/runner-images/issues/12045
This commit is contained in:
Margen67 2025-07-11 03:01:24 -07:00
parent 12a7e4c9c2
commit f2a2812c67
2 changed files with 12 additions and 20 deletions

View file

@ -9,10 +9,10 @@ drivers.
### Windows
* Windows 10 or later
* [Visual Studio 2022, Visual Studio 2019](https://www.visualstudio.com/downloads/)
* [Visual Studio 2022](https://www.visualstudio.com/downloads/)
* [Python 3.9+](https://www.python.org/downloads/)
* Ensure Python is in PATH.
* Windows 11 SDK version 10.0.22000.0 (for Visual Studio 2019, this or any newer version)
* Windows 11 SDK version 10.0.22000.0 (for Visual Studio 2022, this or any newer version)
```
git clone https://github.com/xenia-canary/xenia-canary.git

View file

@ -71,12 +71,13 @@ def import_subprocess_environment(args):
break
VSVERSION_MINIMUM = 2022
def import_vs_environment():
"""Finds the installed Visual Studio version and imports
interesting environment variables into os.environ.
Returns:
A version such as 2015 or None if no installation is found.
A version such as 2022 or None if no installation is found.
"""
if sys.platform != 'win32':
@ -87,7 +88,7 @@ def import_vs_environment():
env_tool_args = None
vswhere = subprocess.check_output(
'tools/vswhere/vswhere.exe -version "[15,)" -latest -prerelease -format json -utf8 -products '
'tools/vswhere/vswhere.exe -version "[17,)" -latest -prerelease -format json -utf8 -products '
"Microsoft.VisualStudio.Product.Enterprise "
"Microsoft.VisualStudio.Product.Professional "
"Microsoft.VisualStudio.Product.Community "
@ -97,16 +98,9 @@ def import_vs_environment():
if vswhere:
vswhere = jsonloads(vswhere)
if vswhere and len(vswhere) > 0:
version = int(vswhere[0].get("catalog", {}).get("productLineVersion", 2017))
version = int(vswhere[0].get("catalog", {}).get("productLineVersion", VSVERSION_MINIMUM))
install_path = vswhere[0].get("installationPath", None)
if version < 2017:
if 'VS140COMNTOOLS' in os.environ:
version = 2015
vcvars_path = os.environ['VS140COMNTOOLS']
vcvars_path = os.path.join(vcvars_path, '..\\..\\vc\\vcvarsall.bat')
env_tool_args = [vcvars_path, 'x64', '&&', 'set']
else:
vsdevcmd_path = os.path.join(install_path, 'Common7\\Tools\\VsDevCmd.bat')
if os.path.isfile(vsdevcmd_path) and os.access(vsdevcmd_path, os.X_OK):
env_tool_args = [vsdevcmd_path, '-arch=amd64', '-host_arch=amd64', '&&', 'set']
@ -539,9 +533,7 @@ def run_platform_premake(target_os_override=None, cc='clang', devenv=None):
if target_os == 'macosx':
devenv = 'xcode4'
elif target_os == 'windows':
vs_version = '2015'
if 'VSVERSION' in os.environ:
vs_version = os.environ['VSVERSION']
vs_version = os.getenv('VSVERSION', VSVERSION_MINIMUM)
devenv = 'vs' + vs_version
elif target_os == 'android':
devenv = 'androidndk'