corrosion-rs / corrosion

Marrying Rust and CMake - Easy Rust and C/C++ Integration!
https://corrosion-rs.github.io/corrosion/
MIT License
1.02k stars 97 forks source link

Set `_CORROSION_VERBOSE_OUTPUT_FLAG` as cache entry #490

Closed mbrobbel closed 4 months ago

mbrobbel commented 4 months ago

The value of the _CORROSION_VERBOSE_OUTPUT_FLAG variable (set based on the CORROSION_VERBOSE_OUTPUT option) isn't propagated to the _add_cargo_build function where it is used: https://github.com/corrosion-rs/corrosion/blob/0a3bdf452995803c334d79dc9a2affbfad51b720/cmake/Corrosion.cmake#L768 Setting it as cache entry fixes that.

mbrobbel commented 4 months ago

Thanks for the PR! I would add a FORCE, so that the internal cache variables are updated when CORROSION_VERBOSE_OUTPUT is changed.

INTERNAL implies FORCE according to https://cmake.org/cmake/help/latest/command/set.html#set-cache-entry:

INTERNAL
... Use of this type implies FORCE.
jschwe commented 4 months ago

Ah, true - thanks for catching that. In that case please drop the commit I added.