extern crate cc; extern crate glob; use std::path::Path; fn main() { let common_dir = Path::new("pqclean/common"); 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() .flag("-std=c99") .include("pqclean/common") .files(common_files.into_iter()) .compile("pqclean_common"); { let mut builder = cc::Build::new(); let target_dir = Path::new("pqclean/crypto_sign/qtesla-p-I/clean"); let scheme_files = glob::glob(target_dir.join("*.c").to_str().unwrap()).unwrap(); builder .flag("-std=c99") .include("pqclean/common") .include(target_dir) .files( scheme_files .into_iter() .map(|p| p.unwrap().to_string_lossy().into_owned()), ); builder.compile("qtesla-p-I_clean"); } { let mut builder = cc::Build::new(); let target_dir = Path::new("pqclean/crypto_sign/qtesla-p-III/clean"); let scheme_files = glob::glob(target_dir.join("*.c").to_str().unwrap()).unwrap(); builder .flag("-std=c99") .include("pqclean/common") .include(target_dir) .files( scheme_files .into_iter() .map(|p| p.unwrap().to_string_lossy().into_owned()), ); builder.compile("qtesla-p-III_clean"); } }