Skip to content

Could we add rpath on macos for libclang.dylib #193

@clouds56

Description

@clouds56

Now when we use system command line tools on macOS, it would generate build-script-build like this

% otool -L target/debug/build/opencv-467c8372860fa8c0/build-script-build
target/debug/build/opencv-467c8372860fa8c0/build-script-build:
	@rpath/libclang.dylib (compatibility version 1.0.0, current version 1700.0.13)
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)

I found it's flags looks like

cargo:rustc-link-search=/Library/Developer/CommandLineTools/usr/lib
cargo:rustc-link-lib=dylib=clang
cargo:include=/Library/Developer/CommandLineTools/usr/include

Could we add linker flags as mentioned in https://users.rust-lang.org/t/is-there-a-way-to-set-rpath-link-to-cargo/3609/3

println!("cargo:rustc-link-arg=-Wl,-rpath-link,/Library/Developer/CommandLineTools/usr/lib");

Which might fixes #41

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions