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
* Windows 10 or later * 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/) * [Python 3.9+](https://www.python.org/downloads/)
* Ensure Python is in PATH. * 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 git clone https://github.com/xenia-canary/xenia-canary.git

View file

@ -71,12 +71,13 @@ def import_subprocess_environment(args):
break break
VSVERSION_MINIMUM = 2022
def import_vs_environment(): def import_vs_environment():
"""Finds the installed Visual Studio version and imports """Finds the installed Visual Studio version and imports
interesting environment variables into os.environ. interesting environment variables into os.environ.
Returns: 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': if sys.platform != 'win32':
@ -87,7 +88,7 @@ def import_vs_environment():
env_tool_args = None env_tool_args = None
vswhere = subprocess.check_output( 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.Enterprise "
"Microsoft.VisualStudio.Product.Professional " "Microsoft.VisualStudio.Product.Professional "
"Microsoft.VisualStudio.Product.Community " "Microsoft.VisualStudio.Product.Community "
@ -97,22 +98,15 @@ def import_vs_environment():
if vswhere: if vswhere:
vswhere = jsonloads(vswhere) vswhere = jsonloads(vswhere)
if vswhere and len(vswhere) > 0: 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) install_path = vswhere[0].get("installationPath", None)
if version < 2017: vsdevcmd_path = os.path.join(install_path, 'Common7\\Tools\\VsDevCmd.bat')
if 'VS140COMNTOOLS' in os.environ: if os.path.isfile(vsdevcmd_path) and os.access(vsdevcmd_path, os.X_OK):
version = 2015 env_tool_args = [vsdevcmd_path, '-arch=amd64', '-host_arch=amd64', '&&', 'set']
vcvars_path = os.environ['VS140COMNTOOLS']
vcvars_path = os.path.join(vcvars_path, '..\\..\\vc\\vcvarsall.bat')
env_tool_args = [vcvars_path, 'x64', '&&', 'set']
else: else:
vsdevcmd_path = os.path.join(install_path, 'Common7\\Tools\\VsDevCmd.bat') vcvars_path = os.path.join(install_path, 'VC\\Auxiliary\\Build\\vcvarsall.bat')
if os.path.isfile(vsdevcmd_path) and os.access(vsdevcmd_path, os.X_OK): env_tool_args = [vcvars_path, 'x64', '&&', 'set']
env_tool_args = [vsdevcmd_path, '-arch=amd64', '-host_arch=amd64', '&&', 'set']
else:
vcvars_path = os.path.join(install_path, 'VC\\Auxiliary\\Build\\vcvarsall.bat')
env_tool_args = [vcvars_path, 'x64', '&&', 'set']
if version == 0: if version == 0:
return None return None
@ -539,9 +533,7 @@ def run_platform_premake(target_os_override=None, cc='clang', devenv=None):
if target_os == 'macosx': if target_os == 'macosx':
devenv = 'xcode4' devenv = 'xcode4'
elif target_os == 'windows': elif target_os == 'windows':
vs_version = '2015' vs_version = os.getenv('VSVERSION', VSVERSION_MINIMUM)
if 'VSVERSION' in os.environ:
vs_version = os.environ['VSVERSION']
devenv = 'vs' + vs_version devenv = 'vs' + vs_version
elif target_os == 'android': elif target_os == 'android':
devenv = 'androidndk' devenv = 'androidndk'