diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-02-09 13:53:44 +0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2017-02-09 00:53:44 -0500 |
commit | f19fef16287a767f133182337e93c478dd48ea93 (patch) | |
tree | 3889967583a9a414b7559a38f147a1a6c762deb1 /src | |
parent | 7a13085afce1415c0524a5dc5b94c98e3d6d7b7d (diff) | |
download | cryptography-f19fef16287a767f133182337e93c478dd48ea93.tar.gz cryptography-f19fef16287a767f133182337e93c478dd48ea93.tar.bz2 cryptography-f19fef16287a767f133182337e93c478dd48ea93.zip |
support defining which windows libraries to link with an env var (#3356)
* support defining which windows libraries to link with an env var
CRYPTOGRAPHY_WINDOWS_LIBRARIES is your new friend
* add some docs
* change to CRYPTOGRAPHY_WINDOWS_LINK_OPENSSL110
* lib prefixing is not a thing msvc does, right
Diffstat (limited to 'src')
-rw-r--r-- | src/_cffi_src/build_openssl.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/_cffi_src/build_openssl.py b/src/_cffi_src/build_openssl.py index 416e1b39..4d2d2c6f 100644 --- a/src/_cffi_src/build_openssl.py +++ b/src/_cffi_src/build_openssl.py @@ -19,9 +19,18 @@ def _get_openssl_libraries(platform): os.environ.get("CRYPTOGRAPHY_OSX_NO_LINK_FLAGS") ) elif platform == "win32": + windows_link_openssl110 = os.environ.get( + "CRYPTOGRAPHY_WINDOWS_LINK_OPENSSL110", None + ) if compiler_type() == "msvc": - libs = ["libeay32", "ssleay32"] + if windows_link_openssl110 is not None: + # Link against the 1.1.0 names + libs = ["libssl", "libcrypto"] + else: + # Link against the 1.0.2 and lower names + libs = ["libeay32", "ssleay32"] else: + # Support mingw, which behaves unix-like and prefixes "lib" libs = ["ssl", "crypto"] return libs + ["advapi32", "crypt32", "gdi32", "user32", "ws2_32"] else: |