@@ -555,40 +555,7 @@ def detect_visual_c_compiler_version(tools_env):
555
555
vc_chosen_compiler_index = - 1
556
556
vc_chosen_compiler_str = ""
557
557
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
592
559
if "VCTOOLSINSTALLDIR" in tools_env :
593
560
# Newer versions have a different path available
594
561
vc_amd64_compiler_detection_index = (
0 commit comments