Don't depend on or-tools for docs.rs
This commit is contained in:
committed by
Guillaume P
parent
2c114536c6
commit
9c8f193ef1
@@ -7,16 +7,18 @@ fn main() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let ortools_prefix = std::env::var("ORTOOLS_PREFIX")
|
||||
.ok()
|
||||
.unwrap_or("/opt/ortools".into());
|
||||
cc::Build::new()
|
||||
.cpp(true)
|
||||
.flag("-std=c++17")
|
||||
.file("src/cp_sat_wrapper.cpp")
|
||||
.include(&[&ortools_prefix, "/include"].concat())
|
||||
.compile("cp_sat_wrapper.a");
|
||||
if !std::env::var("CARGO_FEATURE_DOC").is_ok() {
|
||||
let ortools_prefix = std::env::var("ORTOOLS_PREFIX")
|
||||
.ok()
|
||||
.unwrap_or("/opt/ortools".into());
|
||||
cc::Build::new()
|
||||
.cpp(true)
|
||||
.flag("-std=c++17")
|
||||
.file("src/cp_sat_wrapper.cpp")
|
||||
.include(&[&ortools_prefix, "/include"].concat())
|
||||
.compile("cp_sat_wrapper.a");
|
||||
|
||||
println!("cargo:rustc-link-lib=dylib=ortools");
|
||||
println!("cargo:rustc-link-search=native={}/lib", ortools_prefix);
|
||||
println!("cargo:rustc-link-lib=dylib=ortools");
|
||||
println!("cargo:rustc-link-search=native={}/lib", ortools_prefix);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user