Don't depend on or-tools for docs.rs
This commit is contained in:
committed by
Guillaume P
parent
2c114536c6
commit
9c8f193ef1
@@ -10,6 +10,10 @@ keywords = ["constraint", "programming", "CP"]
|
|||||||
categories = ["api-bindings", "mathematics", "science"]
|
categories = ["api-bindings", "mathematics", "science"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
# the doc feature will not build C++ wrappers (not needed by the doc)
|
||||||
|
doc = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
prost = "0.8"
|
prost = "0.8"
|
||||||
bytes = "1.1.0"
|
bytes = "1.1.0"
|
||||||
@@ -18,3 +22,7 @@ libc = "0.2.101"
|
|||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
prost-build = { version = "0.8" }
|
prost-build = { version = "0.8" }
|
||||||
cc = "1.0"
|
cc = "1.0"
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
features = ["doc"]
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ fn main() {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
if !std::env::var("CARGO_FEATURE_DOC").is_ok() {
|
||||||
let ortools_prefix = std::env::var("ORTOOLS_PREFIX")
|
let ortools_prefix = std::env::var("ORTOOLS_PREFIX")
|
||||||
.ok()
|
.ok()
|
||||||
.unwrap_or("/opt/ortools".into());
|
.unwrap_or("/opt/ortools".into());
|
||||||
@@ -19,4 +20,5 @@ fn main() {
|
|||||||
|
|
||||||
println!("cargo:rustc-link-lib=dylib=ortools");
|
println!("cargo:rustc-link-lib=dylib=ortools");
|
||||||
println!("cargo:rustc-link-search=native={}/lib", ortools_prefix);
|
println!("cargo:rustc-link-search=native={}/lib", ortools_prefix);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user