file(GET_RUNTIME_DEPENDENCIES): propagate parent rpath on macOS
Largely based on what was done for Linux/ELF binaries in #24172 (closed).
A couple of notes:
-
dyld
on macOS prioritises the RPATH entries of the file for which we are looking for dependencies, and then the parents - this is a different priority order than what was implemented for Linux in #24172 (closed). - In the tests, the executable only contains a dependency against
libone.dylib
, but the executable contains RPATH entries for all three libraries (the linux tests was slightly different)
Fixes: #24400 (closed)
Topic-rename: file-GET_RUNTIME_DEPENDENCIES-macos-rpath
Edited by Brad King