summaryrefslogtreecommitdiff
path: root/build.rs
blob: 0f5c26434e8e48f3be8506185580430859a9b36b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use glob::glob;
use std::path::Path;

fn main() {
    println!("cargo:rerun-if-env-changed=DEB_BUILD_OPTIONS");
    let subplots = glob("[a-z]*.md").expect("failed to find subplots");
    let tests = Path::new("tests");
    for entry in subplots {
        let entry = entry.expect("failed to get subplot dir entry");
        let mut inc = tests.join(&entry);
        inc.set_extension("rs");
        if !inc.exists() {
            panic!("missing include file: {}", inc.display());
        }
        println!("cargo:rerun-if-changed={}", inc.display());
        subplot_build::codegen(Path::new(&entry)).expect("failed to generate code with Subplot");
    }
}