From d47e2657f23ec38eb47709844096a822261ca145 Mon Sep 17 00:00:00 2001 From: Max Hilbrunner Date: Tue, 9 Jul 2024 09:02:20 +0200 Subject: [PATCH] Fix VS project generation with SCons 4.8.0+ (cherry picked from commit f682406cf26618d926ed33d7fd43e93de0348d85) --- methods.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/methods.py b/methods.py index 07469f60be1..1cb44e5844a 100644 --- a/methods.py +++ b/methods.py @@ -778,6 +778,7 @@ def detect_visual_c_compiler_version(tools_env): def find_visual_c_batch_file(env): + # TODO: We should investigate if we can avoid relying on SCons internals here. from SCons.Tool.MSCommon.vc import get_default_version, get_host_target, find_batch_file, find_vc_pdir # Syntax changed in SCons 4.4.0. @@ -795,10 +796,11 @@ def find_visual_c_batch_file(env): if scons_ver < (4, 6, 0): return find_batch_file(env, msvc_version, host_platform, target_platform)[0] - # Scons 4.6.0+ removed passing env, so we need to get the product_dir ourselves first, + # SCons 4.6.0+ removed passing env, so we need to get the product_dir ourselves first, # then pass that as the last param instead of env as the first param as before. - # We should investigate if we can avoid relying on SCons internals here. - product_dir = find_vc_pdir(env, msvc_version) + # Param names need to be explicit, as they were shuffled around in SCons 4.8.0. + product_dir = find_vc_pdir(msvc_version=msvc_version, env=env) + return find_batch_file(msvc_version, host_platform, target_platform, product_dir)[0]