Skip to content

Commit 87318a2

Browse files
committedNov 6, 2024··
Merge pull request #98842 from Calinou/scons-vs-detect-remove-pre-2017
Remove pre-Visual Studio 2017 detection code in the buildsystem
2 parents de48d9f + 180f079 commit 87318a2

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed
 

‎methods.py

+1-34
Original file line numberDiff line numberDiff line change
@@ -555,40 +555,7 @@ def detect_visual_c_compiler_version(tools_env):
555555
vc_chosen_compiler_index = -1
556556
vc_chosen_compiler_str = ""
557557

558-
# Start with Pre VS 2017 checks which uses VCINSTALLDIR:
559-
if "VCINSTALLDIR" in tools_env:
560-
# print("Checking VCINSTALLDIR")
561-
562-
# find() works with -1 so big ifs below are needed... the simplest solution, in fact
563-
# First test if amd64 and amd64_x86 compilers are present in the path
564-
vc_amd64_compiler_detection_index = tools_env["PATH"].find(tools_env["VCINSTALLDIR"] + "BIN\\amd64;")
565-
if vc_amd64_compiler_detection_index > -1:
566-
vc_chosen_compiler_index = vc_amd64_compiler_detection_index
567-
vc_chosen_compiler_str = "amd64"
568-
569-
vc_amd64_x86_compiler_detection_index = tools_env["PATH"].find(tools_env["VCINSTALLDIR"] + "BIN\\amd64_x86;")
570-
if vc_amd64_x86_compiler_detection_index > -1 and (
571-
vc_chosen_compiler_index == -1 or vc_chosen_compiler_index > vc_amd64_x86_compiler_detection_index
572-
):
573-
vc_chosen_compiler_index = vc_amd64_x86_compiler_detection_index
574-
vc_chosen_compiler_str = "amd64_x86"
575-
576-
# Now check the 32 bit compilers
577-
vc_x86_compiler_detection_index = tools_env["PATH"].find(tools_env["VCINSTALLDIR"] + "BIN;")
578-
if vc_x86_compiler_detection_index > -1 and (
579-
vc_chosen_compiler_index == -1 or vc_chosen_compiler_index > vc_x86_compiler_detection_index
580-
):
581-
vc_chosen_compiler_index = vc_x86_compiler_detection_index
582-
vc_chosen_compiler_str = "x86"
583-
584-
vc_x86_amd64_compiler_detection_index = tools_env["PATH"].find(tools_env["VCINSTALLDIR"] + "BIN\\x86_amd64;")
585-
if vc_x86_amd64_compiler_detection_index > -1 and (
586-
vc_chosen_compiler_index == -1 or vc_chosen_compiler_index > vc_x86_amd64_compiler_detection_index
587-
):
588-
vc_chosen_compiler_index = vc_x86_amd64_compiler_detection_index
589-
vc_chosen_compiler_str = "x86_amd64"
590-
591-
# and for VS 2017 and newer we check VCTOOLSINSTALLDIR:
558+
# VS 2017 and newer should set VCTOOLSINSTALLDIR
592559
if "VCTOOLSINSTALLDIR" in tools_env:
593560
# Newer versions have a different path available
594561
vc_amd64_compiler_detection_index = (

0 commit comments

Comments
 (0)
Please sign in to comment.