This adjusts the rerun-if-changed directives issued by build.rs so that files generated by CMake are not rebuild triggers anymore. Instead, the source files in the bundled directory open62541/ themselves are used as triggers.
This avoids rebuild loops: until now, when build.rs was run, it would run a second time afterwards (on the next cargo check, cargo build, etc.) because it would see that the files generated by CMake in the first run were changed recently.
The effect can be seen by running cargo clean, followed by two times cargo check. Before the changes, the second cargo would rebuild the crate a second time, now it doesn't. Touching a file in open62541/ or wrapper.c/wrapper.h or build.rs itself still triggers a rebuild as intended.
Alternatively, to verify, you can also inspect target/debug/build/open62541-sys-(…)/output and check the lines rerun-if-changed manually before and after the change.
Description
This adjusts the
rerun-if-changed
directives issued bybuild.rs
so that files generated by CMake are not rebuild triggers anymore. Instead, the source files in the bundled directoryopen62541/
themselves are used as triggers.This avoids rebuild loops: until now, when
build.rs
was run, it would run a second time afterwards (on the nextcargo check
,cargo build
, etc.) because it would see that the files generated by CMake in the first run were changed recently.The effect can be seen by running
cargo clean
, followed by two timescargo check
. Before the changes, the secondcargo
would rebuild the crate a second time, now it doesn't. Touching a file inopen62541/
orwrapper.c
/wrapper.h
orbuild.rs
itself still triggers a rebuild as intended.