diff --git a/Cargo.toml b/Cargo.toml index 46be514c1..1272b7265 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ edition = "2021" default = [] bindgen = ["gdal-sys/bindgen"] array = ["ndarray"] +docsrs = [] [dependencies] thiserror = "1.0" @@ -38,3 +39,4 @@ members = ["gdal-sys"] [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] +features = [ "docsrs" ] diff --git a/build.rs b/build.rs index 04b27b890..43c6edaed 100644 --- a/build.rs +++ b/build.rs @@ -1,11 +1,11 @@ use std::str::FromStr; -#[cfg(docsrs)] +#[cfg(feature = "docsrs")] pub fn gdal_version_info(_key: &str) -> String { "3020000".to_string() } -#[cfg(not(docsrs))] +#[cfg(not(feature = "docsrs"))] pub fn gdal_version_info(key: &str) -> String { let c_key = std::ffi::CString::new(key.as_bytes()).unwrap();