- docs.rs detection when built as dependency

This commit is contained in:
w.pomp
2026-08-07 17:32:27 +02:00
parent ebc5b84a2c
commit 3860af8815
3 changed files with 7 additions and 5 deletions
+3 -1
View File
@@ -115,7 +115,9 @@ fn fix_xwin_lib_case() -> Result<(), Box<dyn std::error::Error>> {
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
if env::var("DOCS_RS").is_err() {
if env::var("DOCS_RS").is_ok() {
println!("cargo::rustc-cfg=docsrs");
} else {
let host = env::var("HOST")?;
let target = env::var("TARGET")?;
let is_cross = host != target