xlsynth / xlsynth-crate

Rust crate that publishes XLSynth capabilities (wrapping libxlsynth.so/.dylib)
https://crates.io/crates/xlsynth
Apache License 2.0
0 stars 1 forks source link

build: link using rustc #13

Open proppy opened 3 weeks ago

proppy commented 3 weeks ago

This add rustc cargo directives to link to libxls dso using regular C compiler flags (-L and -l) rather than relying on libloading.

This has the advantage of decoupling c_api.rs from the linkage type and can also allow static linking (and thus fixes #1) in bazel based environment.

This also patch the DSO using install_name_tool so that ld doesn't fail to link by trying to discover it from the bazel build path.

proppy commented 1 week ago

PTAL, managed to patch the LC_ID_DYLIB command in buid.rs using install_name_tool so that ld doesn't fail to link directly to it.

Note that it would be better to do this as part of https://github.com/xlsynth/xlsynth/tree/cdleary/release-dylib-workflow release process instead.