Add an option to output a depfile for outside build-systems to learn the source file dependencies of the bindings. This can be used by 3rd party build system integrations to only rerun bindgen when necessary. Testing is done via CMake integration tests, since CMake is a 3rd party buildsystem which supports depfiles.
702 B
702 B
This a folder containing tests for --depfile
parameter.
Each test is in a subfolder and defines a minimum CMake project,
which uses cbindgen to generate Rust bindings and the --depfile
parameter to determine when to regenerate.
The outer test can the build the project, assert that rebuilding does not regenerate the
bindings, and then assert that touching the files involved does trigger rebuilding.
The test project must contain an expectations
folder, containing a file dependencies
.
This dependencies
should list all files that should be listed as dependencies in the generated
depfile. The paths should be relative to the project folder (i.e. to the folder containing
expectations
).