diff options
author | Giannis Adamopoulos <johnyadams@outlook.com> | 2014-10-19 18:03:31 +0300 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2014-11-10 23:23:22 +0100 |
commit | 18514b5e52d52e1fe87abd2830871e1f3e902f49 (patch) | |
tree | 4e7412487ad342046e29238bc1ee92bf3a6d82c5 | |
parent | e91f1c8b61bab65d19a3169cb9c9d2d2fb84e232 (diff) |
Add support for msvc
-rw-r--r-- | setup.py | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -180,7 +180,24 @@ class MyBuildExt(build_ext): ext.sources.append(os.path.join(AMALGAMATION_ROOT, "sqlite3.c")) ext.include_dirs.append(AMALGAMATION_ROOT) - ext.extra_link_args.append("-lcrypto") + if sys.platform == "win32": + # Try to locate openssl + openssl_conf = os.environ.get('OPENSSL_CONF') + if not openssl_conf: + sys.exit('Fatal error: OpenSSL could not be detected!') + openssl = os.path.dirname(os.path.dirname(openssl_conf)) + + # Configure the compiler + ext.include_dirs.append(os.path.join(openssl, "include")) + 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") + ) + else: + ext.extra_link_args.append("-lcrypto") if self.static: self._build_extension(ext) |