@@ -330,16 +330,23 @@ def _copy_vendor_libraries(self):
330
330
if not self .with_mysql_capi or not is_wheel :
331
331
return
332
332
333
+ data_files = []
334
+
333
335
if os .name == "nt" :
334
336
openssl_libs = ["ssleay32.dll" , "libeay32.dll" ]
335
337
vendor_folder = ""
336
338
mysql_capi = os .path .join (self .with_mysql_capi , "bin" )
339
+ # Bundle libmysql.dll
340
+ src = os .path .join (self .with_mysql_capi , "lib" , "libmysql.dll" )
341
+ dst = os .getcwd ()
342
+ log .info ("copying {0} -> {1}" .format (src , dst ))
343
+ shutil .copy (src , dst )
344
+ data_files .append ("libmysql.dll" )
337
345
else :
338
346
openssl_libs = self ._get_posix_openssl_libs ()
339
347
vendor_folder = "mysql-vendor"
340
348
mysql_capi = os .path .join (self .with_mysql_capi , "lib" )
341
349
342
- data_files = []
343
350
if vendor_folder :
344
351
mkpath (os .path .join (os .getcwd (), vendor_folder ))
345
352
@@ -725,6 +732,10 @@ def _finalize_connector_c(self, connc_loc):
725
732
lib_file_path = os .path .join (self .connc_lib , lib_file )
726
733
if os .path .isfile (lib_file_path ) and not lib_file .endswith ('.a' ):
727
734
os .unlink (os .path .join (self .connc_lib , lib_file ))
735
+ elif os .name == 'nt' :
736
+ self .include_dirs .extend ([self .connc_include ])
737
+ self .libraries .extend (['libmysql' ])
738
+ self .library_dirs .extend ([self .connc_lib ])
728
739
729
740
def _finalize_protobuf (self ):
730
741
if not self .with_protobuf_include_dir :
0 commit comments