- docs.rs detection when built as dependency

This commit is contained in:
w.pomp committed 2026-08-07 17:32:27 +02:00
1 parent ebc5b84a2c
commit 3860af8815
3 files changed
+7 -5

No files matched your search

+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