Always use Ninja generator when building cmake projects form source#1736
Open
sbc100 wants to merge 1 commit into
Open
Always use Ninja generator when building cmake projects form source#1736sbc100 wants to merge 1 commit into
sbc100 wants to merge 1 commit into
Conversation
sbc100
marked this pull request as draft
July 15, 2026 23:15
sbc100
force-pushed
the
ninja_windows
branch
2 times, most recently
from
July 16, 2026 01:32
3268f42 to
d2395b3
Compare
Collaborator
Author
|
I'm adding |
sbc100
added a commit
that referenced
this pull request
Jul 21, 2026
We may start using it internally in emscripten. See emscripten-core/emscripten#17809 Its also useful to be able to install it when building other things from source (See #1736)
Collaborator
Author
|
@juj, what do you think about this? Can we just standardize of the Ninja generator? |
sbc100
force-pushed
the
ninja_windows
branch
3 times, most recently
from
July 21, 2026 17:54
f36efbb to
13d6498
Compare
sbc100
marked this pull request as ready for review
July 21, 2026 17:56
Collaborator
Author
|
In the emscripten-releases repo we already are ninja-only: https://chromium.googlesource.com/emscripten-releases/+/refs/heads/main/src/build.py |
…ource When building tools from source, unconditionally use the Ninja generator. This massively simplifies the Windows build process allowing for the removal of `--vs2019`, `--vs2022`, `--mingw` and `--generator` flags along with `vswhere` detection, Visual Studio multi-config output paths, and the `mingw` SDK package. Instead can now rely on MSCV being configured in the environment prior to running emsdk, and since #1105 landed ninja is also always available via emsdk. See: #1734
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When building tools from source, unconditionally use the Ninja
generator.
Since #1105 landed ninja is also always available via emsdk.
This massively simplifies the Windows build process allowing for the
removal of
--vs2019,--vs2022,--mingwand--generatorflagsalong with
vswheredetection, Visual Studio multi-config output paths,and the
mingwSDK package.This also allows us to completely remove all the
NUM_COREShandlingsince ninja is really good and using all the cores automatically (no need to
pass -j at all). If folks really want to control the parallelism they can still
do so using the
CMAKE_BUILD_PARALLEL_LEVELenvironment variable (https://cmake.org/cmake/help/latest/envvar/CMAKE_BUILD_PARALLEL_LEVEL.html)Instead, we now rely on MSCV being configured in the environment prior
to running emsdk. i.e. We expect windows users to run in a Visual Studio
command prompt (or with
vcvarsall.bathaving been already run). Thisseems like a more sensible soltution that trying to build visual studio selection
into emsdk itself. i.e. we can just expect users to have already selected their
prefered visual studio version.
See: #1734