extern crate cc; extern crate glob; use cc::Build; use glob::glob; use std::process::Command; fn main() { Build::new() .flag(&String::from_utf8_lossy( &Command::new("pkg-config") .arg("--cflags") .arg("--libs") .arg("x11") .output() .unwrap() .stdout, )) .files( glob("./src/c/*.c") .expect("Could not build c file globs") .map(|file| file.unwrap().as_path().display().to_string()) .collect::>(), ) .include("src") .compile("c"); }