Skip to content

Commit

Permalink
docs: fix docs.rs build without linking
Browse files Browse the repository at this point in the history
  • Loading branch information
my4ng authored and faern committed Jul 23, 2024
1 parent 0a2779e commit 89cb7c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nftnl-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ fn get_env(var: &'static str) -> Option<PathBuf> {
}

fn main() {
// Do NOT link when building documentation on docs.rs
if std::env::var("DOCS_RS").is_ok() {
return;
}

if let Some(lib_dir) = get_env("LIBNFTNL_LIB_DIR") {
if !lib_dir.is_dir() {
panic!(
Expand Down

0 comments on commit 89cb7c4

Please sign in to comment.