apt-pkg-native/build.rs

22 lines
409 B
Rust
Raw Normal View History

2018-04-14 20:43:04 +01:00
extern crate cc;
2017-07-13 13:49:36 +01:00
const SRC: &str = "apt-pkg-c/lib.cpp";
fn main() {
println!("cargo:rerun-if-changed={}", SRC);
2018-04-14 20:43:04 +01:00
let mut build = cc::Build::new();
2017-12-12 20:29:27 +00:00
build.file(SRC);
build.cpp(true);
build.flag("-std=gnu++11");
2018-04-12 20:35:08 +01:00
#[cfg(feature = "ye-olde-apt")]
2017-12-12 20:29:27 +00:00
{
build.define("YE_OLDE_APT", "1");
}
build.compile("libapt-pkg-c.a");
println!("cargo:rustc-link-lib=apt-pkg");
}