Fixes based on comments regarding building on windows.

Specifically, python 3.9 and newer does not consume quotes on the
command line, so additional escaping is not needed.

Secondly, openssl lib name may be libcrypto.lib on newer openssl
versions, so I've added an option to specify this with an environment
variable OPENSSL_LIBNAME (which defaults to libeay32.lib for now).
This commit is contained in:
Charles Leifer 2020-12-21 04:39:00 -06:00
parent f1399e94ed
commit 7d4e2f4edd

View file

@ -32,8 +32,8 @@ if sys.platform == "darwin":
def quote_argument(arg): def quote_argument(arg):
quote = '"' if sys.platform != 'win32' else '\\"' q = '\\"' if sys.platform == 'win32' and sys.version_info < (3, 9) else '"'
return quote + arg + quote return q + arg + q
define_macros = [('MODULE_NAME', quote_argument(PACKAGE_NAME + '.dbapi2'))] define_macros = [('MODULE_NAME', quote_argument(PACKAGE_NAME + '.dbapi2'))]
@ -129,7 +129,8 @@ class AmalgationLibSqliteBuilder(build_ext):
ext.define_macros.append(("inline", "__inline")) ext.define_macros.append(("inline", "__inline"))
# Configure the linker # Configure the linker
ext.extra_link_args.append("libeay32.lib") openssl_libname = os.environ.get('OPENSSL_LIBNAME') or 'libeay32.lib'
ext.extra_link_args.append(openssl_libname)
ext.extra_link_args.append('/LIBPATH:' + openssl_lib_path) ext.extra_link_args.append('/LIBPATH:' + openssl_lib_path)
build_ext.build_extension(self, ext) build_ext.build_extension(self, ext)