gn
with MinGW on WindowsAt the time of writing: 2024-04-13 Test environment: Windows 11, intel x86_64 CPU
clang32.exe
, clang64.exe
, clangarm64.exe
,mingw32.exe
, mingw64.exe
, ucrt64.exe
.pacman -S mingw-w64-clang-x86_64-toolchain mingw-w64-clang-x86_64-ninja git
gn
gn
source code, run command: git clone https://gn.googlesource.com/gn
cd gn
build/gen.py --platform mingw
--help
flag to check more configuration options.--allow-warning
flag to build with warnings.ninja -C out
out/gn --version
out/gn_unittests
Notes:
For “mingw-w64-clang-x86_64-toolchain” in the clang64 environment, g++ is a copy of clang++.
The toolchain that builds
gn
does not use vendor lock-in compiler command flags, sogn
can be built with these clang++, g++.However the build rules in examples/simple_build require GCC-specific compiler macros, and thus only work in the
ucrt64
MSYS2 development environment.