using DOCS_RS to detect docsrs

master
Niko PLP 7 months ago
parent 8965930ecd
commit 87f6cc1ec0
  1. 2
      Cargo.toml
  2. 4
      librocksdb-sys/build.rs
  3. 3
      src/lib.rs

@ -1,7 +1,7 @@
[package] [package]
name = "ng-rocksdb" name = "ng-rocksdb"
description = "Rust wrapper for Facebook's RocksDB embeddable database, fork for Nextgraph.org" description = "Rust wrapper for Facebook's RocksDB embeddable database, fork for Nextgraph.org"
version = "0.21.0-ngpreview.2" version = "0.21.0-ngpreview.3"
edition = "2018" edition = "2018"
rust-version = "1.60" rust-version = "1.60"
authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>"] authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>"]

@ -438,6 +438,7 @@ fn cxx_standard() -> String {
}) })
} }
#[allow(dead_code)]
fn update_submodules() { fn update_submodules() {
let program = "git"; let program = "git";
let dir = "../"; let dir = "../";
@ -461,6 +462,9 @@ fn update_submodules() {
fn main() { fn main() {
if !Path::new("librocksdb-sys/rocksdb/AUTHORS").exists() { if !Path::new("librocksdb-sys/rocksdb/AUTHORS").exists() {
println!("cargo:rustc-cfg=NG_ROCKS_DB_NOT_FOUND"); println!("cargo:rustc-cfg=NG_ROCKS_DB_NOT_FOUND");
if std::env::var("DOCS_RS").is_ok() {
println!("cargo:rustc-cfg=DOCS_RS");
}
return; return;
//update_submodules(); //update_submodules();
} }

@ -71,8 +71,9 @@
clippy::missing_panics_doc, clippy::missing_panics_doc,
clippy::from_over_into, clippy::from_over_into,
)] )]
#![cfg(not(DOCS_RS))]
#[cfg(all(not(docsrs), NG_ROCKS_DB_NOT_FOUND))] #[cfg(all(not(DOCS_RS), NG_ROCKS_DB_NOT_FOUND))]
std::compile_error!("empty librocksdb-sys/rocksdb directory"); std::compile_error!("empty librocksdb-sys/rocksdb directory");
#[macro_use] #[macro_use]

Loading…
Cancel
Save