Skip to content

Commit

Permalink
disable c++ library build on docs.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrjabs committed Jan 11, 2024
1 parent ba47a0d commit ef59dc0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion cadical/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ use std::{
};

fn main() {
if std::env::var("DOCS_RS").is_ok() {
// don't build c++ library on docs.rs due to network restrictions
return;
}

#[cfg(all(feature = "quiet", feature = "logging"))]
compile_error!("cannot combine cadical features quiet and logging");

Expand Down Expand Up @@ -60,7 +65,6 @@ fn main() {
};

// Build C++ library
#[cfg(not(doc))]
build(
"https://github.com/arminbiere/cadical.git",
"master",
Expand Down
6 changes: 5 additions & 1 deletion glucose/build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
use std::{env, fs, path::Path, str};

fn main() {
if std::env::var("DOCS_RS").is_ok() {
// don't build c++ library on docs.rs due to network restrictions
return;
}

// Build C++ library
// Full commit hash needs to be provided
#[cfg(not(doc))]
build(
"https://github.com/chrjabs/glucose4.git",
"main",
Expand Down
6 changes: 5 additions & 1 deletion kissat/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ use std::{
};

fn main() {
if std::env::var("DOCS_RS").is_ok() {
// don't build c library on docs.rs due to network restrictions
return;
}

// Select commit based on features. If conflict, always choose newest release
let tag = if cfg!(feature = "v3-1-1") {
"refs/tags/rel-3.1.1"
Expand All @@ -29,7 +34,6 @@ fn main() {

// Build C library
// Full commit hash needs to be provided
#[cfg(not(doc))]
build("https://github.com/arminbiere/kissat.git", "master", tag);

let out_dir = env::var("OUT_DIR").unwrap();
Expand Down
6 changes: 5 additions & 1 deletion minisat/build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
use std::{env, fs, path::Path, str};

fn main() {
if std::env::var("DOCS_RS").is_ok() {
// don't build c++ library on docs.rs due to network restrictions
return;
}

// Build C++ library
// Full commit hash needs to be provided
#[cfg(not(doc))]
build(
"https://github.com/chrjabs/minisat.git",
"master",
Expand Down

0 comments on commit ef59dc0

Please sign in to comment.