aboutsummaryrefslogtreecommitdiffstats
path: root/bindings/rust/libflashrom/build.rs
blob: 9908ebbc2ca90bbfd660e69078dfa18d8b41e524 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate cc;

fn main() {
    // pkg_config is needed only to pick up the include path for log.c to use.
    // libflashrom-sys tells cargo how to link to libflashrom.
    let flashrom = pkg_config::Config::new()
        .cargo_metadata(false)
        .probe("flashrom")
        .unwrap();
    let mut log_c = cc::Build::new();
    log_c.file("src/log.c");
    for p in flashrom.include_paths {
        log_c.include(p);
    }
    log_c.compile("log.o");
    println!("cargo:rerun-if-changed=src/log.c");
}