Skip to content

build: Skip configure when no variable has changed #82195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Steelskin
Copy link
Contributor

build.ps1 always re-runs the configuration step before building since some of the CMake variables might have changed between 2 runs. This takes time in incremental builds for something that is not required most of the time.

These changes read CMakeCache.txt and compare the values in the file with the ones that would be used in the configure invocation and skips it if they are identical. This greatly speeds up incremental builds.

Local testing of a no-op incremental build has shown an improvement of almost 3 minutes in build time on Windows x64 building all 3 SDKs with no packaging, going from 6min10s before these changes to 3min30s with these changes.

`build.ps1` always re-runs the configuration step before building since
some of the CMake variables might have changed between 2 runs. This
takes time in incremental builds for something that is not required most
of the time.

These changes read `CMakeCache.txt` and compare the values in the file
with the ones that would be used in the configure invocation and skips
it if they are identical. This greatly speeds up incremental builds.

Local testing of a no-op incremental build has shown an improvement of
almost 3 minutes in build time on Windows x64 building all 3 SDKs with
no packaging, going from 6min10s before these changes to 3min30s with
these changes.
@Steelskin Steelskin requested a review from compnerd as a code owner June 11, 2025 20:36

if (-not $NeedsConfigure) {
# Check if the CMake generator has changed
if ($CMakeCache["CMAKE_GENERATOR"] -ne $Generator) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this changes, but might want to check it before enumarating/checking the cache entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants