Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generating vsproj with SCons 4.6.0+ #85357

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,25 +708,28 @@ 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,
)
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.
from SCons import __version__ as scons_raw_version

scons_ver = env._get_major_minor_revision(scons_raw_version)

version = get_default_version(env)
msvc_version = get_default_version(env)

if scons_ver >= (4, 4, 0):
(host_platform, target_platform, _) = get_host_target(env, version)
(host_platform, target_platform, _) = get_host_target(env, msvc_version)
else:
(host_platform, target_platform, _) = get_host_target(env)

return find_batch_file(env, version, host_platform, target_platform)[0]
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,
# 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)
return find_batch_file(msvc_version, host_platform, target_platform, product_dir)[0]


def generate_cpp_hint_file(filename):
Expand Down
Loading