pub fn add_libpython_rpath_link_args()Expand description
Adds linker arguments to set rpath when embedding Python within a Rust binary.
When running tests or binaries built with PyForge, the Python dynamic library needs to be found at runtime.
This can be done by setting environment variables like DYLD_LIBRARY_PATH on macOS,
LD_LIBRARY_PATH on Linux, or PATH on Windows.
Altrnatively (as per this function) rpath can be set at link time to point to the directory containing the Python dynamic library. This avoids the need to set environment variables, so can be convenient, however may not be appropriate for binaries packaged for distribution.
See PyForge’s guide for more details.