diff options
Diffstat (limited to 'subplot-build')
-rw-r--r-- | subplot-build/src/lib.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/subplot-build/src/lib.rs b/subplot-build/src/lib.rs index 89ea57d..28558e8 100644 --- a/subplot-build/src/lib.rs +++ b/subplot-build/src/lib.rs @@ -48,21 +48,26 @@ where buildrs_output(out_dir, filename, "rs").expect("could not create output filename"); // Generate test program. - let output = subplot::codegen(filename, &test_rs)?; + let output = subplot::codegen(filename, &test_rs, Some("rust"))?; // Write instructions for Cargo to check if build scripts needs // re-running. let base_path = get_basedir_from(filename); let meta = output.doc.meta(); - buildrs_deps(&base_path, &meta.bindings_filenames()); - buildrs_deps(&base_path, &meta.functions_filenames()); - buildrs_deps(&base_path, &[filename]); + buildrs_deps(&base_path, meta.bindings_filenames()); + let docimpl = output + .doc + .meta() + .document_impl("rust") + .expect("We managed to codegen rust, yet the spec is missing?"); + buildrs_deps(&base_path, docimpl.functions_filenames()); + buildrs_deps(&base_path, Some(filename)); event!(Level::TRACE, "Finished generating code"); Ok(()) } -fn buildrs_deps(base_path: &Path, filenames: &[&Path]) { +fn buildrs_deps<'a>(base_path: &Path, filenames: impl IntoIterator<Item = &'a Path>) { for filename in filenames { let filename = base_path.join(filename); if filename.exists() { |