From e0214a14f3a6172a4fbd139d4b3a3e6c2623b285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 31 Jul 2022 13:58:05 +0200 Subject: [PATCH] SCons: Fix creating VS solution with SCons 4.4.0 Fixes #63709. Co-authored-by: 19PHOBOSS98 <37253663+19PHOBOSS98@users.noreply.github.com> (cherry picked from commit 89847dc6e34e1caf589a03fdcc3aecd193d9bd1f) --- methods.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/methods.py b/methods.py index 9b8cb38c0c1..c550c4815bc 100644 --- a/methods.py +++ b/methods.py @@ -619,8 +619,18 @@ def detect_visual_c_compiler_version(tools_env): def find_visual_c_batch_file(env): from SCons.Tool.MSCommon.vc import get_default_version, get_host_target, find_batch_file + # Syntax changed in SCons 4.4.0. + from SCons import __version__ as scons_raw_version + + scons_ver = env._get_major_minor_revision(scons_raw_version) + version = get_default_version(env) - (host_platform, target_platform, _) = get_host_target(env) + + if scons_ver >= (4, 4, 0): + (host_platform, target_platform, _) = get_host_target(env, version) + else: + (host_platform, target_platform, _) = get_host_target(env) + return find_batch_file(env, version, host_platform, target_platform)[0]