Skip to content

Commit

Permalink
Print out rerun-if-changed keys to properly recompile
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Mar 16, 2016
1 parent c30b0cf commit a2cf6be
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ struct Generator<'a> {
c: Box<Write>,
sh: &'a SpanHandler,
structs: HashSet<String>,
files: HashSet<String>,
abi: Abi,
tests: Vec<String>,
sess: &'a ParseSess,
opts: &'a TestGenerator,
}

Expand Down Expand Up @@ -617,6 +619,8 @@ impl TestGenerator {
structs: structs.structs,
abi: Abi::C,
tests: Vec::new(),
files: HashSet::new(),
sess: &sess,
opts: self,
};
t!(writeln!(gen.c, "#include <stdint.h>"));
Expand Down Expand Up @@ -1215,6 +1219,10 @@ impl<'a, 'v> Visitor<'v> for Generator<'a> {

_ => {}
}
let file = self.sess.codemap().span_to_filename(i.span);
if self.files.insert(file.clone()) {
println!("cargo:rerun-if-changed={}", file);
}
visit::walk_item(self, i);
self.abi = prev_abi;
}
Expand Down

0 comments on commit a2cf6be

Please sign in to comment.