You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing doc examples for the bindings of a C library.
In my RUSTFLAGS, I add a search path for the C library using -L /path/to/lib. (needed because I am using a custom version of the library that's not installed globally)
cargo build/run picks this up fine, and the C library links correctly.
However, doc tests cause a linking error, because RUSTFLAGS seem to be ignored when compiling doc examples.
The text was updated successfully, but these errors were encountered:
Ok so as pointed out by @rkruppe I was corrected in that we actually can't do this blindly per se. That is, rustdoc doesn't currently have a feature for "pass these flags to the compiler".
What you can do today, however, is hopefully use RUSTDOCFLAGS!
(Moved from rust-lang/rust#37330)
I am writing doc examples for the bindings of a C library.
In my
RUSTFLAGS
, I add a search path for the C library using-L /path/to/lib
. (needed because I am using a custom version of the library that's not installed globally)cargo build/run
picks this up fine, and the C library links correctly.However, doc tests cause a linking error, because
RUSTFLAGS
seem to be ignored when compiling doc examples.The text was updated successfully, but these errors were encountered: