You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During development I run make to ensure new code can compile.
With cmake I expect only the files with changes to be rebuilt.
Since I started using corrosion_experimental_cbindgen (v0.4), whatever includes the generated header gets rebuilt every time.
The contents of the header did not change, only the timestamp changed.
Suggestion: generate to a temporary directory and use configure_file(COPYONLY) to update the wanted header.
This should provide the cmake-like experience of only rebuilding when there are changes.
The text was updated successfully, but these errors were encountered:
configure_file is only available at CMake configure time, it's not a build command. It's not suitable because the bindings will not be regenerated if the rust code changes.
You need to use the most recent version of Corrosion, and use cbindgen 0.26 (or newer). If you don't have cbindgen installed at all, thats also fine - corrosion will build it for you.
The newest version of cbindgen generates a so called depfile (see mozilla/cbindgen#820), which lists which rust files the generated bindings depend on. Corrosion, then uses this depfile to tell CMake when the cbindgen command needs to be rerun.
The depfile feature requires a more recent CMake version then Corrosion v0.4 requires, so it is only used on the latest master (future v0.5 version) which already requires a sufficienlty new CMake version.
I'll be closing this issue for now, but if you still encounter this on the latest master version, the please reopen the issue and provide some more information so I can reproduce.
During development I run
make
to ensure new code can compile.With
cmake
I expect only the files with changes to be rebuilt.Since I started using
corrosion_experimental_cbindgen
(v0.4), whatever includes the generated header gets rebuilt every time.The contents of the header did not change, only the timestamp changed.
Suggestion: generate to a temporary directory and use
configure_file(COPYONLY)
to update the wanted header.This should provide the
cmake
-like experience of only rebuilding when there are changes.The text was updated successfully, but these errors were encountered: