[cmake] Run normal compiler auto-detection by default #23537
Merged
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.
This change disables
EMSCRIPTEN_FORCE_COMPILERS
by default which means cmake will run all the normal compiler detection phases. This has the advantage that things get setup correctly without taking any shortcuts. See #23444.The downside is the that cmake phase itself is now slower since its needs to compiler, link and run a bunch of test binaries.
On my machine running all the cmake tests went from 27 to 36 seconds. Running a single empty cmake project when from 1s to 4.5s. Since running cmake is normally rare compared to building the project itself I think this slowdown is worth it, but I've left the
EMSCRIPTEN_FORCE_COMPILERS
setting in place for now that folks that want fast cmake.Also, remember that cmake itself caches all this stuff so its only the first run that get slowed down.