apt-pkg-native/build.rs
Alexander Burmatov 51f7abc311 New feature
2024-08-02 18:57:04 +03:00

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");
}