You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am struggling to build a CMake subproject which links to an external library. Any suggestions would be highly appreciated 🙏
Issue
I tried various cmake and meson setting options, but the build RUNPATH of targets in cmake modules is not set as I would expect. Even when passing CMAKE_BUILD_RPATH_USE_ORIGIN and CMAKE_BUILD_RPATH explicitely via .add_cmake_defines the library runpath is empty.
MWE
I created a MWE in the attachment for linux: mini_meson.zip
To run, you will need:
a somewhat recent clang / lld / ninja
cmake
readelf
Just extract it and execute the commands in "./commands.sh".
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am struggling to build a CMake subproject which links to an external library. Any suggestions would be highly appreciated 🙏
Issue
I tried various cmake and meson setting options, but the build RUNPATH of targets in cmake modules is not set as I would expect. Even when passing
CMAKE_BUILD_RPATH_USE_ORIGIN
andCMAKE_BUILD_RPATH
explicitely via.add_cmake_defines
the library runpath is empty.MWE
I created a MWE in the attachment for linux: mini_meson.zip
To run, you will need:
Just extract it and execute the commands in "./commands.sh".
What it does:
readelf -d <target>
for the library and executable from the cmake subproject, and the executable from the main meson project.Project Settings
My current settings:
machine file:
meson.build:
Expected vs actual behavior
RUNPATH of
mod_a_app
(the executable from the cmake subproject) to look like... instead, only $ORIGIN is set
RUNPATH of
libmod_a_lib.so
(the library from the cmake subproject) to look like... instead, no rpath is set.
The RUNPATH of
meson_app
(the executable from the meson subproject) is as expected:system parameters
[EDIT] improved formatting
Beta Was this translation helpful? Give feedback.
All reactions