diff options
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..0f5c264 --- /dev/null +++ b/build.rs @@ -0,0 +1,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"); + } +} |