servicepoint-binding-c/examples/lang_c/build.rs
Vinzenz Schroeter c069c1966b
All checks were successful
Rust / build (push) Successful in 1m48s
split crate into own repository
2025-02-15 12:39:31 +01:00

18 lines
533 B
Rust

const SP_INCLUDE: &str = "DEP_SERVICEPOINT_INCLUDE";
fn main() {
println!("cargo::rerun-if-changed=src/main.c");
println!("cargo::rerun-if-changed=build.rs");
println!("cargo::rerun-if-env-changed={SP_INCLUDE}");
let sp_include =
std::env::var_os(SP_INCLUDE).unwrap().into_string().unwrap();
// this builds a lib, this is only to check that the example compiles
let mut cc = cc::Build::new();
cc.file("src/main.c");
cc.include(&sp_include);
cc.opt_level(2);
cc.compile("lang_c");
}