@@ -262,6 +262,7 @@ def generate_def(dll, dfile):
262262def find_dll (dll_name ):
263263
264264 arch = {'AMD64' : 'amd64' ,
265+ 'ARM64' : 'arm64' ,
265266 'Intel' : 'x86' }[get_build_architecture ()]
266267
267268 def _find_dll_in_winsxs (dll_name ):
@@ -351,6 +352,8 @@ def build_import_library():
351352 arch = get_build_architecture ()
352353 if arch == 'AMD64' :
353354 return _build_import_library_amd64 ()
355+ if arch == 'ARM64' :
356+ return _build_import_library_arm64 ()
354357 elif arch == 'Intel' :
355358 return _build_import_library_x86 ()
356359 else :
@@ -412,6 +415,26 @@ def _build_import_library_amd64():
412415 cmd = ['dlltool' , '-d' , def_file , '-l' , out_file ]
413416 subprocess .check_call (cmd )
414417
418+ def _build_import_library_arm64 ():
419+ out_exists , out_file = _check_for_import_lib ()
420+ if out_exists :
421+ log .debug ('Skip building import library: "%s" exists' , out_file )
422+ return
423+
424+ # get the runtime dll for which we are building import library
425+ dll_file = find_python_dll ()
426+ log .info ('Building import library (arch=ARM64): "%s" (from %s)' %
427+ (out_file , dll_file ))
428+
429+ # generate symbol list from this library
430+ def_name = "python%d%d.def" % tuple (sys .version_info [:2 ])
431+ def_file = os .path .join (sys .prefix , 'libs' , def_name )
432+ generate_def (dll_file , def_file )
433+
434+ # generate import library from this symbol list
435+ cmd = ['dlltool' , '-d' , def_file , '-l' , out_file ]
436+ subprocess .check_call (cmd )
437+
415438def _build_import_library_x86 ():
416439 """ Build the import libraries for Mingw32-gcc on Windows
417440 """
0 commit comments