extern crate cc;
use std::env;
use std::path::Path;
fn main() {
if Path::new("backend/blossomV/PerfectMatching.h").exists() {
println!("cargo:rustc-cfg=feature=\"blossom_v\"");
let target_os = env::var("CARGO_CFG_TARGET_OS");
let mut build = cc::Build::new();
build
.cpp(true)
.file("backend/blossomV/blossomV.cpp")
.file("backend/blossomV/PMinterface.cpp")
.file("backend/blossomV/PMduals.cpp")
.file("backend/blossomV/PMexpand.cpp")
.file("backend/blossomV/PMinit.cpp")
.file("backend/blossomV/PMmain.cpp")
.file("backend/blossomV/PMrepair.cpp")
.file("backend/blossomV/PMshrink.cpp")
.file("backend/blossomV/misc.cpp")
.file("backend/blossomV/MinCost/MinCost.cpp");
if target_os != Ok("macos".to_string()) {
build.cpp_link_stdlib("stdc++"); build.flag("-Wno-unused-but-set-variable"); }
build
.flag("-Wno-unused-parameter")
.flag("-Wno-unused-variable")
.flag("-Wno-reorder-ctor")
.flag("-Wno-reorder")
.compile("blossomV");
println!("cargo:rerun-if-changed=backend/blossomV/blossomV.cpp");
println!("cargo:rerun-if-changed=backend/blossomV/PerfectMatching.h");
println!("cargo:rustc-link-lib=static=blossomV");
if target_os != Ok("macos".to_string()) {
println!("cargo:rustc-link-lib=dylib=stdc++"); }
}
}