eclipse-iceoryx / iceoryx2

Eclipse iceoryx2™ - true zero-copy inter-process-communication in pure Rust
https://iceoryx.io
Apache License 2.0
444 stars 22 forks source link

FFI 'dylib' build on macOS is broken #233

Open elBoberido opened 1 week ago

elBoberido commented 1 week ago

Required information

Operating system: macOS; any version

Rust version: any version

Cargo version: any version

iceoryx2 version: main branch

Observed result or behaviour: The dylib generated by Rust has a dependency to the target folder. Using cmake to install the library retains this dependency.

Run otool -L libiceoryx2_ffi.dylib to list all the dependencies.

Expected result or behaviour: The dylib should not have a dependency to the target folder

Conditions where it occurred / Performed steps:

Check if the discovery C example links to shared libs.

cmake -B target/ffi/build -DCMAKE_INSTALL_PREFIX="target/ffi/install" .
cmake --build target/ffi/build
cmake --install target/ffi/build

Run the discovery C example

cmake -B target/ffi/out-of-tree -CMAKE_PREFIX_PATH="full/path/to/target/ffi/install" -Hexamples/c
target/ffi/out-of-tree/discovery/example-c-discovery

Run otool

otool -L target/ffi/build/rust/release/libiceoryx2_ffi.dylib