This ensures that running CMake will only result in the generated
files being overwritten if their contents will change. This is
important because these files are used as build inputs, and so every
time these files are written, their downstream dependants may be
marked as dirty during the build, and so downstream dependencies end
up needlessly re-building every time when file WRITE is used.
For example, if you're generating Makefiles and you're using the
convenient add_shader function to add shaderc build commands to your
build when shader sources change, this change prevents shaderc from
being needlessly re-linked (which often takes minutes) on the first
build after every CMake run.
This ensures that running CMake will only result in the generated files being overwritten if their contents will change. This is important because these files are used as build inputs, and so every time these files are written, their downstream dependants may be marked as dirty during the build, and so downstream dependencies end up needlessly re-building every time when
file WRITE
is used.For example, if you're generating Makefiles and you're using the convenient
add_shader
function to add shaderc build commands to your build when shader sources change, this change preventsshaderc
from being needlessly re-linked (which often takes minutes) on the first build after every CMake run.