34 lines
633 B
Rust
34 lines
633 B
Rust
extern crate cc;
|
|
|
|
const SRC: &str = "apt-pkg-c/lib.cpp";
|
|
|
|
fn main() {
|
|
println!("cargo:rerun-if-changed={}", SRC);
|
|
|
|
let mut build = cc::Build::new();
|
|
build.file(SRC);
|
|
build.cpp(true);
|
|
#[cfg(feature = "alt-linux")]
|
|
{
|
|
build.flag("-std=gnu++17");
|
|
}
|
|
#[cfg(not(feature = "alt-linux"))]
|
|
{
|
|
build.flag("-std=gnu++11");
|
|
}
|
|
|
|
#[cfg(feature = "ye-olde-apt")]
|
|
{
|
|
build.define("YE_OLDE_APT", "1");
|
|
}
|
|
|
|
#[cfg(feature = "alt-linux")]
|
|
{
|
|
build.define("ALT_LINUX", "1");
|
|
}
|
|
|
|
build.compile("libapt-pkg-c.a");
|
|
|
|
println!("cargo:rustc-link-lib=apt-pkg");
|
|
}
|