Are RPaths transitive?
We have a quite complicated CMake-based build system, and have an issue on Linux (but not Mac) where sometimes the build fails. I've narrowed down the difference in failure to the -rpath
option during linking. To cut a long story short, my question is this:
If you link with a library using target_link_libraries(foo PRIVATE bar)
, and bar
is a shared library, should the path to bar
be added to foo
's RPATH
? I.e. when linking libfoo.so
should the link command include -rpath /directory/containing/bar
?
In our build, sometimes it is and sometimes it isn't. Which is the intended behaviour?