summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-12-04 12:43:21 +0200
committerLars Wirzenius <liw@liw.fi>2021-12-04 12:43:21 +0200
commit69d172e06ce957d24e8ff07e42120ad2006bdc9a (patch)
treede7dd0818c5c532e885be750d721f38946c9614f
parent5b44d85265184a49ba2040045865d9247da7eb65 (diff)
downloadobnam-benchmark-69d172e06ce957d24e8ff07e42120ad2006bdc9a.tar.gz
build.rs
Sponsored-by: author
-rw-r--r--build.rs18
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");
+ }
+}