Skip to content

Commit

Permalink
(fix) ffi.dlopen() needs full lib name under windows?
Browse files Browse the repository at this point in the history
  • Loading branch information
MementoRC committed Dec 21, 2023
1 parent 45fc8ad commit 5e03265
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions setup_support.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
import os
import shutil
import subprocess
import sys
from contextlib import contextmanager, suppress
from distutils.extension import Extension
from tempfile import mkdtemp
@@ -73,9 +74,11 @@ def _find_lib():

pkgconfig.configure_extension(extension, 'libsecp256k1', static=False)
package_info = pkgconfig.parse('libsecp256k1', static=False)
print(package_info)

ffi.dlopen('secp256k1')
if os.name == 'nt' or sys.platform == 'win32':
ffi.dlopen('libsecp256k1-2')
else:
ffi.dlopen('secp256k1')

return os.path.exists(os.path.join(package_info['include_dirs'][0], 'secp256k1_ecdh.h'))
except OSError:

0 comments on commit 5e03265

Please sign in to comment.