Skip to content

Commit c5ea353

Browse files
author
Martin Larralde
committed
Use Cargo.toml defined lib name to find compiled dylibs
1 parent f7cc84d commit c5ea353

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

setuptools_rust/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ def build_extension(self, ext):
186186
dylib_ext = "dylib"
187187
else:
188188
dylib_ext = "so"
189-
ext.basename = ext.name.rsplit('.', 1)[-1]
190-
wildcard_so = "*{}.{}".format(ext.basename, dylib_ext)
189+
190+
wildcard_so = "*{}.{}".format(ext.get_lib_name(), dylib_ext)
191191

192192
try:
193193
dylib_paths.append((

setuptools_rust/extension.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
from distutils.errors import DistutilsSetupError
66
from .utils import Binding, Strip
77

8+
try:
9+
import configparser
10+
except ImportError:
11+
import ConfigParser as configparser
12+
813

914
import semantic_version
1015

@@ -91,6 +96,11 @@ def __init__(self, target, path,
9196

9297
self.path = path
9398

99+
def get_lib_name(self):
100+
cfg = configparser.ConfigParser()
101+
cfg.read(self.path)
102+
return cfg.get('lib', 'name').strip('"')
103+
94104
def get_rust_version(self):
95105
if self.rust_version is None:
96106
return None

0 commit comments

Comments
 (0)