extern crate cc; extern crate glob; use std::path::PathBuf; fn main() { let common_dir: PathBuf = ["pqclean", "common"].iter().collect(); let common_files = vec![ common_dir.join("fips202.c"), common_dir.join("aes.c"), common_dir.join("sha2.c"), common_dir.join("randombytes.c"), common_dir.join("sp800-185.c"), ]; cc::Build::new() .include(&common_dir) .files(common_files.into_iter()) .compile("pqclean_common"); { let mut builder = cc::Build::new(); let target_dir: PathBuf = ["pqclean", "crypto_sign", "mqdss-48", "clean"] .iter() .collect(); let scheme_files = glob::glob(target_dir.join("*.c").to_str().unwrap()).unwrap(); builder.include(&common_dir).include(target_dir).files( scheme_files .into_iter() .map(|p| p.unwrap().to_string_lossy().into_owned()), ); builder.compile("mqdss-48_clean"); } { let mut builder = cc::Build::new(); let target_dir: PathBuf = ["pqclean", "crypto_sign", "mqdss-64", "clean"] .iter() .collect(); let scheme_files = glob::glob(target_dir.join("*.c").to_str().unwrap()).unwrap(); builder.include(&common_dir).include(target_dir).files( scheme_files .into_iter() .map(|p| p.unwrap().to_string_lossy().into_owned()), ); builder.compile("mqdss-64_clean"); } }