Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable c++ library build on docs.rs #53

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 4 additions & 0 deletions rustsat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,9 @@ all = [
[lib]
crate-type = ["lib", "staticlib", "cdylib"]

[package.metadata.docs.rs]
features = ["all"]
rustdoc-args = ["--cfg", "docsrs"]

[[example]]
name = "profiling"
1 change: 1 addition & 0 deletions rustsat/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
//! For an example of how to use the C-API, see `rustsat/examples/capi*.cpp`.
//! Similarly, for an example of using the Python API, see `rustsat/examples/pyapi*.py`.

#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(feature = "bench", feature(test))]

pub mod encodings;
Expand Down
Loading