Fixed crypto library name for windows

This commit is contained in:
Jürg Rast 2019-08-25 23:57:05 +02:00
parent 2209f56cd5
commit 7203a8bbb9
1 changed files with 12 additions and 2 deletions

View File

@ -1,6 +1,9 @@
# Support code for building a C extension with crypto code
import os
import sys
is_win32 = sys.platform.startswith('win32')
def multi_join(paths, *path_segments):
@ -11,9 +14,16 @@ def multi_join(paths, *path_segments):
def crypto_ext_kwargs(pc, system_prefix):
if system_prefix:
print('Detected OpenSSL [via BORG_OPENSSL_PREFIX]')
if is_win32:
lib_dir = system_prefix
lib_name = 'libcrypto'
else:
lib_dir = os.path.join(system_prefix, 'lib')
lib_name = 'crypto'
return dict(include_dirs=[os.path.join(system_prefix, 'include')],
library_dirs=[os.path.join(system_prefix, 'lib')],
libraries=['crypto'])
library_dirs=[lib_dir],
libraries=[lib_name])
if pc and pc.exists('libcrypto'):
print('Detected OpenSSL [via pkg-config]')