@@ -178,30 +178,24 @@ def _find_exe(exe, paths=None):
178
178
return exe
179
179
180
180
181
- def _get_plat_to_vcvars ():
182
- # A map keyed by get_platform() return values to values accepted by
183
- # 'vcvarsall.bat'.
184
- if get_platform () == get_host_platform () == "win-arm64" :
185
- # Use the native MSVC host if the host platform would need expensive
186
- # emulation for x86.
187
- return {
188
- 'win32' : 'arm64_x86' ,
189
- 'win-amd64' : 'arm64_amd64' ,
190
- 'win-arm32' : 'arm64_arm' ,
191
- 'win-arm64' : 'arm64' ,
192
- }
193
- else :
194
- # Always cross-compile from x86 to work with the lighter-weight MSVC
195
- # installs that do not include native 64-bit tools.
196
- return {
197
- 'win32' : 'x86' ,
198
- 'win-amd64' : 'x86_amd64' ,
199
- 'win-arm32' : 'x86_arm' ,
200
- 'win-arm64' : 'x86_arm64' ,
201
- }
202
-
203
-
204
- PLAT_TO_VCVARS = _get_plat_to_vcvars ()
181
+ if get_host_platform () == "win-arm64" :
182
+ # Use the native MSVC host if the host platform would need expensive
183
+ # emulation for x86.
184
+ PLAT_TO_VCVARS = {
185
+ 'win32' : 'arm64_x86' ,
186
+ 'win-amd64' : 'arm64_amd64' ,
187
+ 'win-arm32' : 'arm64_arm' ,
188
+ 'win-arm64' : 'arm64' ,
189
+ }
190
+ else :
191
+ # Always cross-compile from x86 to work with the lighter-weight MSVC
192
+ # installs that do not include native 64-bit tools.
193
+ PLAT_TO_VCVARS = {
194
+ 'win32' : 'x86' ,
195
+ 'win-amd64' : 'x86_amd64' ,
196
+ 'win-arm32' : 'x86_arm' ,
197
+ 'win-arm64' : 'x86_arm64' ,
198
+ }
205
199
206
200
207
201
class MSVCCompiler (CCompiler ):
0 commit comments