@@ -567,9 +567,9 @@ def finalize_options(self):
567
567
print ("# Python ARCH_64BIT: {0}" .format (ARCH_64BIT ))
568
568
569
569
if self .with_mysql_capi :
570
- if os .name != "nt " :
570
+ if os .name == "posix " :
571
571
self .mysql_info = mysql_c_api_info (self .with_mysql_capi )
572
- self ._copy_vendor_libraries ()
572
+ self ._copy_vendor_libraries ()
573
573
self ._finalize_connector_c (self .with_mysql_capi )
574
574
575
575
if not self .with_protobuf_include_dir :
@@ -671,7 +671,7 @@ def fix_compiler(self):
671
671
if self .extra_compile_args :
672
672
ext .extra_compile_args .extend (self .extra_compile_args .split ())
673
673
# Add extra link args
674
- if self .extra_link_args :
674
+ if self .extra_link_args and ext . name == "_mysql_connector" :
675
675
ext .extra_link_args .extend (self .extra_link_args .split ())
676
676
# Add -rpath if the platform is Linux and cext is _mysql_connector
677
677
if platform .system () == "Linux" and ext .name == "_mysql_connector" :
@@ -727,7 +727,7 @@ def run(self):
727
727
if self .extra_compile_args :
728
728
ext .extra_compile_args .extend (self .extra_compile_args .split ())
729
729
# Add extra link args
730
- if self .extra_link_args and ext .name != "_mysqlxpb " :
730
+ if self .extra_link_args and ext .name == "_mysql_connector " :
731
731
ext .extra_link_args .extend (self .extra_link_args .split ())
732
732
if self .with_mysqlxpb_cext :
733
733
self .run_protoc ()
@@ -780,6 +780,10 @@ class BuildExtStatic(BuildExtDynamic):
780
780
user_options = build_ext .user_options + CEXT_OPTIONS
781
781
782
782
def finalize_options (self ):
783
+ if self .with_mysql_capi and os .name == "posix" :
784
+ self .mysql_info = mysql_c_api_info (self .with_mysql_capi )
785
+ self ._copy_vendor_libraries ()
786
+
783
787
install_obj = self .distribution .get_command_obj ('install' )
784
788
install_obj .with_mysql_capi = self .with_mysql_capi
785
789
install_obj .with_protobuf_include_dir = self .with_protobuf_include_dir
@@ -821,9 +825,6 @@ def finalize_options(self):
821
825
self .with_protobuf_lib_dir ,
822
826
self .with_protoc ))
823
827
if self .with_mysql_capi :
824
- if os .name != "nt" :
825
- self .mysql_info = mysql_c_api_info (self .with_mysql_capi )
826
- self ._copy_vendor_libraries ()
827
828
self ._finalize_connector_c (self .with_mysql_capi )
828
829
829
830
if self .with_mysqlxpb_cext :
@@ -959,7 +960,7 @@ def fix_compiler(self):
959
960
if self .extra_compile_args :
960
961
ext .extra_compile_args .extend (self .extra_compile_args .split ())
961
962
# Add extra link args
962
- if self .extra_link_args and ext .name != "_mysqlxpb " :
963
+ if self .extra_link_args and ext .name == "_mysql_connector " :
963
964
ext .extra_link_args .extend (self .extra_link_args .split ())
964
965
965
966
0 commit comments