Skip to content
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

[cmake] Run normal compiler auto-detection by default #23537

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jan 29, 2025

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.

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 emscripten-core#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.
@sbc100 sbc100 force-pushed the cmake_force_compiler branch from dcf1b2f to 8f8b3fd Compare January 29, 2025 22:46
@sbc100 sbc100 requested a review from dschuff January 29, 2025 22:47
@sbc100 sbc100 requested a review from kripken January 29, 2025 23:02
@sbc100 sbc100 enabled auto-merge (squash) January 29, 2025 23:23
@sbc100 sbc100 merged commit ffcebb7 into emscripten-core:main Jan 30, 2025
29 checks passed
@sbc100 sbc100 deleted the cmake_force_compiler branch January 30, 2025 17:48
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.

3 participants