[bug] setup does only work with msvc compiler
authorPaixuAabuizia <PaixuAabuizia@users.noreply.github.com>
Sun, 24 Jan 2016 13:36:33 +0000 (14:36 +0100)
committerPaixuAabuizia <PaixuAabuizia@users.noreply.github.com>
Sun, 24 Jan 2016 13:36:33 +0000 (14:36 +0100)
add compiler detection for msvc & mingw32

setup.py

index 6db3492..80e5918 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -192,10 +192,13 @@ class MyBuildExt(build_ext):
                 ext.define_macros.append(("inline", "__inline"))
 
                 # Configure the linker
-                ext.extra_link_args.append("libeay32.lib")
-                ext.extra_link_args.append(
-                    "/LIBPATH:" + os.path.join(openssl, "lib")
-                )
+                if self.compiler.compiler_type == "msvc":
+                    ext.extra_link_args.append("libeay32.lib")
+                    ext.extra_link_args.append(
+                        "/LIBPATH:" + os.path.join(openssl, "lib")
+                    )
+                if self.compiler.compiler_type == "mingw32":
+                    ext.extra_link_args.append("-lcrypto")     
             else:
                 ext.extra_link_args.append("-lcrypto")