From 2013aedf6666e9a4756091795b9098faeb7ec344 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Mon, 24 Aug 2020 19:47:31 +0800 Subject: [PATCH] build(sys): fix docsrs build --- sys/Cargo.toml | 2 +- sys/build.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/Cargo.toml b/sys/Cargo.toml index b875dd68..d9de274a 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -27,4 +27,4 @@ regex = "1.3" semver = "0.10" [package.metadata.docs.rs] -rustc-args = ["--cfg", "docsrs"] +rustc-args = ["--cfg", "napidocsrs"] diff --git a/sys/build.rs b/sys/build.rs index 6533a30e..e09e17a8 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -14,7 +14,7 @@ use std::env; use std::path::PathBuf; use std::process::Command; -#[cfg(not(any(target_os = "windows", docsrs)))] +#[cfg(not(any(target_os = "windows", napidocsrs)))] const NODE_PRINT_EXEC_PATH: &'static str = "console.log(process.execPath)"; fn main() { @@ -55,7 +55,7 @@ fn main() { .expect("Unable to write napi bindings"); } -#[cfg(all(target_os = "windows", not(docsrs)))] +#[cfg(all(target_os = "windows", not(napidocsrs)))] fn find_node_include_path(node_full_version: &str) -> PathBuf { let mut out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); out_path.push(format!("node-headers-{}.tar.gz", node_full_version)); @@ -81,14 +81,14 @@ fn find_node_include_path(node_full_version: &str) -> PathBuf { header_dist_path } -#[cfg(docsrs)] +#[cfg(napidocsrs)] fn find_node_include_path(_node_full_version: &str) -> PathBuf { let mut current = env::current_dir().unwrap(); current.push(".node-headers"); current } -#[cfg(not(any(target_os = "windows", docsrs)))] +#[cfg(not(any(target_os = "windows", napidocsrs)))] fn find_node_include_path(_node_full_version: &str) -> PathBuf { let node_exec_path = String::from_utf8( Command::new("node")