@@ -101,7 +101,7 @@ def detect_build_env_arch():
101
101
"arm64" : "arm64" ,
102
102
"aarch64" : "arm64" ,
103
103
}
104
- if os .getenv ("VCINSTALLDIR" ) or os . getenv ( " VCTOOLSINSTALLDIR" ):
104
+ if os .getenv ("VCTOOLSINSTALLDIR" ):
105
105
if os .getenv ("Platform" ):
106
106
msvc_arch = os .getenv ("Platform" ).lower ()
107
107
if msvc_arch in msvc_target_aliases .keys ():
@@ -112,32 +112,11 @@ def detect_build_env_arch():
112
112
if msvc_arch in msvc_target_aliases .keys ():
113
113
return msvc_target_aliases [msvc_arch ]
114
114
115
- # Pre VS 2017 checks.
116
- if os .getenv ("VCINSTALLDIR" ):
117
- PATH = os .getenv ("PATH" ).upper ()
118
- VCINSTALLDIR = os .getenv ("VCINSTALLDIR" ).upper ()
119
- path_arch = {
120
- "BIN\\ x86_ARM;" : "arm32" ,
121
- "BIN\\ amd64_ARM;" : "arm32" ,
122
- "BIN\\ x86_ARM64;" : "arm64" ,
123
- "BIN\\ amd64_ARM64;" : "arm64" ,
124
- "BIN\\ x86_amd64;" : "a86_64" ,
125
- "BIN\\ amd64;" : "x86_64" ,
126
- "BIN\\ amd64_x86;" : "x86_32" ,
127
- "BIN;" : "x86_32" ,
128
- }
129
- for path , arch in path_arch .items ():
130
- final_path = VCINSTALLDIR + path
131
- if final_path in PATH :
132
- return arch
133
-
134
- # VS 2017 and newer.
135
- if os .getenv ("VCTOOLSINSTALLDIR" ):
136
- host_path_index = os .getenv ("PATH" ).upper ().find (os .getenv ("VCTOOLSINSTALLDIR" ).upper () + "BIN\\ HOST" )
137
- if host_path_index > - 1 :
138
- first_path_arch = os .getenv ("PATH" )[host_path_index :].split (";" )[0 ].rsplit ("\\ " , 1 )[- 1 ].lower ()
139
- if first_path_arch in msvc_target_aliases .keys ():
140
- return msvc_target_aliases [first_path_arch ]
115
+ host_path_index = os .getenv ("PATH" ).upper ().find (os .getenv ("VCTOOLSINSTALLDIR" ).upper () + "BIN\\ HOST" )
116
+ if host_path_index > - 1 :
117
+ first_path_arch = os .getenv ("PATH" )[host_path_index :].split (";" )[0 ].rsplit ("\\ " , 1 )[- 1 ].lower ()
118
+ if first_path_arch in msvc_target_aliases .keys ():
119
+ return msvc_target_aliases [first_path_arch ]
141
120
142
121
msys_target_aliases = {
143
122
"mingw32" : "x86_32" ,
0 commit comments