Implement CONFIGURE_DEPENDS flag in our GLOBs. #13750
Open
+9
−3
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.
As discussed in #13704 we should likely be using
CONFIGURE_DEPENDS
to ensure that CMake will automatically reconfigure if you trigger a build but have added files that should be picked up by our GLOBs. This is a relatively minor but it's good practice when using GLOBs in CMake.Description
As far as implementation, in theory all we need is to add
CONFIGURE_DEPENDS
when usingfile(GLOB ...)
, but we do some extra globs for simplicity based on args we get insdl_glob_sources
, which means sometimes we're doing aGLOB
with no expressions, whichCONFIGURE_DEPENDS
doesn't like. So I've adjusted to make sure we check there's actually an expression before calling into it.Regarding performance, and I should note that this is just a repeat of my comment in the previous PR when this was discussed, I did some testing locally, I'm not noticing anything that I would be able to consistently nail down without just running builds over and over again. I pushed it up to CI and while it wasn't faster than the previous run on the branch, it was faster than a different run on the same commit.
Previous Commit Run 1: https://github.com/playmer/SDL-1/actions/runs/16858095731
Previous Commit Run 2: https://github.com/playmer/SDL-1/actions/runs/16857983229
CONFIGURE_DEPENDS Commit: https://github.com/playmer/SDL-1/actions/runs/16953366708
The flag should mostly affect incremental builds, as CMake needs to insert globs to run before building your code. I did a quick run of a rebuild by inserting blank lines in
SDL.h
and again found nothing notable:(Omitted the actual cmake/build output, but the full logs are here: https://gist.github.com/playmer/7d2c0bc75d694e582c08601f23f5b72b)
With Changes:
Without changes: