Skip to content

Commit 98c0616

Browse files
committed
TST: use platform specific anchors in RPATH entries
macOS requires using `@loader_path` in place of `$ORIGIN`.
1 parent c2e7036 commit 98c0616

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

tests/packages/sharedlib-in-package/meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ project('sharedlib-in-package', 'c', version: '1.0.0')
66

77
py = import('python').find_installation(pure: false)
88

9+
origin = build_machine.system() == 'darwin' ? '@loader_path' : '$ORIGIN'
10+
911
subdir('src')
1012
subdir('mypkg')

tests/packages/sharedlib-in-package/mypkg/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ py.extension_module(
1111
# install_rpath is not exposed in the Meson introspection data in Meson
1212
# versions prior to 1.6.0 and thus cannot be set by meson-python when
1313
# building the Python wheel. Use link_args to set the RPATH.
14-
# install_rpath: '$ORIGIN',
15-
link_args: '-Wl,-rpath,$ORIGIN',
14+
# install_rpath: f'@origin@',
15+
link_args: f'-Wl,-rpath,@origin@',
1616
)
1717

1818
py.install_sources(

tests/packages/sharedlib-in-package/src/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ lib = shared_library(
3333
# install_rpath is not exposed in the Meson introspection data in Meson
3434
# versions prior to 1.6.0 and thus cannot be set by meson-python when
3535
# building the Python wheel. Use link_args to set the RPATH.
36-
# install_rpath: '$ORIGIN/sub',
37-
link_args: '-Wl,-rpath,$ORIGIN/sub',
36+
# install_rpath: f'@origin@/sub',
37+
link_args: f'-Wl,-rpath,@origin@/sub',
3838
)
3939

4040
lib_dep = declare_dependency(

0 commit comments

Comments
 (0)