I have a "build.rs" program which generates a file in OUT_DIR, the official place for generated files. The generated file has to be included in the source tree and compiled into the project. So I have a file in the project which contains only
include!(concat!(env!("OUT_DIR"), "/msgdefs.rs"));
This follows the directions in https://rust-lang.github.io/rust-bindgen/tutorial-4.html
Works fine. The question is, what tells Cargo when to recompile that file? If the included file changes, will it be recompiled? Or do I need to do something to make that happen? How does Cargo know?