From f2a2812c67119f64ed653868e89cbe1b418911fd Mon Sep 17 00:00:00 2001 From: Margen67 Date: Fri, 11 Jul 2025 03:01:24 -0700 Subject: [PATCH] Require Visual Studio 2022 https://github.com/actions/runner-images/issues/12045 --- docs/building.md | 4 ++-- xenia-build | 28 ++++++++++------------------ 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/docs/building.md b/docs/building.md index c76363772..52a621b83 100644 --- a/docs/building.md +++ b/docs/building.md @@ -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 diff --git a/xenia-build b/xenia-build index 4a3e65172..8ab08193d 100755 --- a/xenia-build +++ b/xenia-build @@ -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,22 +98,15 @@ 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'] + 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'] 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'] - else: - vcvars_path = os.path.join(install_path, 'VC\\Auxiliary\\Build\\vcvarsall.bat') - env_tool_args = [vcvars_path, 'x64', '&&', 'set'] + vcvars_path = os.path.join(install_path, 'VC\\Auxiliary\\Build\\vcvarsall.bat') + env_tool_args = [vcvars_path, 'x64', '&&', 'set'] if version == 0: return None @@ -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'