1 #[cfg(not(feature = "cmake"))]
2 fn main() -> std::io::Result<()> {
3 let mut make = cc::Build::new();
4 make.include("include");
5 make.define("A_EXPORTS", None);
6 #[cfg(feature = "float")]
7 make.define("A_SIZE_FLOAT", "4");
8 #[cfg(feature = "static_crt")]
11 for entry in std::fs::read_dir("src")? {
12 let path = entry?.path();
13 let extension = path.extension().unwrap();
14 if path.is_file() & extension.eq("c") {
22 #[cfg(feature = "cmake")]
24 let mut cmake = cmake::Config::new("");
26 cmake.define("BUILD_TESTING", "0");
27 #[cfg(feature = "float")]
28 cmake.define("LIBA_FLOAT", "4");
29 #[cfg(feature = "static_crt")]
30 cmake.static_crt(true);
32 let out = cmake.build();
33 let lib = out.join("lib");
35 println!("cargo:rustc-link-search=native={}", lib.display());
36 println!("cargo:rustc-link-lib=static=a");