Skip to content

Commit 1e9430e

Browse files
committed
TST: use linker flags instead of install_rpath to set the RPATH
meson-python does not support `install_rpath` yet and anyhow `install_rpath` is not exposed in the introspection data and thus cannot be set by meson-python when building the Python wheel. Use `link_args` to set the RPATH.
1 parent d47c524 commit 1e9430e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ py.extension_module(
88
dependencies: lib_dep,
99
install: true,
1010
subdir: 'mypkg',
11-
install_rpath: '$ORIGIN',
11+
# install_rpath is not exposed in the Meson introspection data in Meson
12+
# versions prior to 1.6.0 and thus cannot be set by meson-python when
13+
# building the Python wheel. Use link_args to set the RPATH.
14+
# install_rpath: '$ORIGIN',
15+
link_args: '-Wl,-rpath,$ORIGIN',
1216
)
1317

1418
py.install_sources(

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ lib = shared_library(
3030
c_args: export_dll_args,
3131
install: true,
3232
install_dir: py.get_install_dir() / 'mypkg',
33-
install_rpath: '$ORIGIN/sub',
33+
# install_rpath is not exposed in the Meson introspection data in Meson
34+
# versions prior to 1.6.0 and thus cannot be set by meson-python when
35+
# building the Python wheel. Use link_args to set the RPATH.
36+
# install_rpath: '$ORIGIN/sub',
37+
link_args: '-Wl,-rpath,$ORIGIN/sub',
3438
)
3539

3640
lib_dep = declare_dependency(

0 commit comments

Comments
 (0)