build: Avoid rebuilds due to processing of fmt headers #4313
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This continues the adventure from #4082 where the processing of fmt headers, both locally built and externally referenced, causes large rebuilds to occur when making small or even zero changes between builds.
Since that previous PR is stuck I'll try again here.
This makes two sets of changes:
copy_if_different
to prevent redundant copies from occuring, and triggering timestamp updates (in the local build case)Note that while this seems to fix the problem, the build is still not "clean" wrt fmt processing. The following will be be seen when triggering a build, with zero changes since the last build, within VS:
Whatever it is, the VS generator doesn't much like the way we're handling the processing but I don't know enough cmake-fu to ascertain why that might be.
Checklist:
(adding new test cases if necessary).
corresponding Python bindings (and if altering ImageBufAlgo functions, also
exposed the new functionality as oiiotool options).
already run clang-format before submitting, I definitely will look at the CI
test that runs clang-format and fix anything that it highlights as being
nonconforming.