From 3860af8815a01b9e6245362f484a22a2fe232ab1 Mon Sep 17 00:00:00 2001 From: "w.pomp" Date: Fri, 7 Aug 2026 17:32:27 +0200 Subject: [PATCH] - docs.rs detection when built as dependency --- Cargo.toml | 6 +++--- README.md | 2 +- build.rs | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2f473bf..ee05020 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "libczirw-sys" -version = "0.5.0" +version = "0.5.1" edition = "2024" rust-version = "1.85.1" authors = ["Wim Pomp "] license = "MIT OR Apache-2.0" description = "Wrapper around libCZIAPI" -homepage = "https://git.wimpomp.nl/wim/libczirw-sys" -repository = "https://git.wimpomp.nl/wim/libczirw-sys" +homepage = "https://git.pomppervova.nl/wim/libczirw-sys" +repository = "https://git.pomppervova.nl/wim/libczirw-sys" documentation = "https://docs.rs/libczirw-sys" readme = "README.md" keywords = ["czi", "zeiss", "libczi"] diff --git a/README.md b/README.md index b98f9c6..85f9672 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # libCZIrw-sys Crate linking to [libCZIAPI](https://github.com/ZEISS/libczi). This crate attempts to provide safe wrappers to objects -and functions in libCZIAPI. Direct often unsafe access using pointer is available through the `sys` module. +and functions in libCZIAPI. Direct often unsafe access using pointers is available through the `sys` module. By default, libCZIAPI will be statically linked. The feature `dynamic` will switch it to dynamic linking. diff --git a/build.rs b/build.rs index c51c52e..5fd6724 100644 --- a/build.rs +++ b/build.rs @@ -115,7 +115,9 @@ fn fix_xwin_lib_case() -> Result<(), Box> { } fn main() -> Result<(), Box> { - 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