Skip to content

Commit 7ca831d

Browse files
committed
test: remove rpath on macOS
Signed-off-by: Filipe Laíns <lains@riseup.net>
1 parent f0df536 commit 7ca831d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_hook.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ def test_header_only_library(env, tmp_path, packages, monkeypatch):
2020
env.install_wheel(wheel)
2121

2222
# Remove rpath, as meson insists on setting it
23+
uses_library_path = os.path.join(env.scheme['platlib'], 'uses_library' + sysconfig.get_config_var('EXT_SUFFIX'))
2324
if sys.platform == 'linux':
24-
uses_library_path = os.path.join(env.scheme['platlib'], 'uses_library' + sysconfig.get_config_var('EXT_SUFFIX'))
2525
subprocess.check_call(['patchelf', '--remove-rpath', uses_library_path])
26+
elif sys.platform == 'darwin':
27+
subprocess.check_call(['install_name_tool', '-change', '@rpath/libfoo.dylib', 'libfoo.dylib', uses_library_path])
2628

2729
# Make sure uses_library.foo() works
2830
assert env.introspectable.call('uses_library.foo', 1, 2) == 3

0 commit comments

Comments
 (0)