WindowsCompiler enum

Windows C++ compiler selection.

Inheritance
Available extensions

Values

msvc → const WindowsCompiler

Microsoft Visual C++ (cl.exe), the default.

clangCl → const WindowsCompiler

LLVM clang-cl — the MSVC-compatible clang driver.

Requires an LLVM installation (e.g. from https://llvm.org or the Visual Studio "C++ Clang tools for Windows" component) and the Visual Studio C++ workload (the Windows SDK headers/libs and the MSVC STL are still consumed from the VS installation).

Build-mode notes:

  • With CmakeGenerator.ninja (the recommended mode, also the default when WindowsConfig.generator is null), the builder initializes the MSVC environment via vcvarsall.bat first, then locates clang-cl: an explicit WindowsConfig.clangClPath wins, then a VS-bundled clang-cl (visible on the vcvars PATH when the VS Clang component is installed), then PATH / LLVM installs / the LLVM registry key. The resolved compiler is passed via -DCMAKE_C(XX)_COMPILER=<clang-cl>, so clang-cl does not need to be on PATH beforehand.
  • With CmakeGenerator.msbuild, the builder passes -T clangcl to CMake, which selects the clang-cl toolset inside Visual Studio.
msys2Clang → const WindowsCompiler

MSYS2 ucrt64 clang — the GNU/MinGW-style clang toolchain (x86_64-w64-windows-gnu target), e.g. from the mingw-w64-ucrt-x86_64-clang package.

This is a completely different ABI from MSVC: no vcvarsall.bat environment is needed (the toolchain carries its own headers and libraries), and the produced DLL links against the MSYS2 runtime (libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll from <msys2>\ucrt64\bin) instead of the MSVC CRT. Make sure those DLLs are on PATH (or bundled) at runtime.

Build-mode notes:

  • Only CmakeGenerator.ninja is supported (the default when WindowsConfig.generator is null). MSBuild / Makefiles are not usable with a GNU-style toolchain.
  • The builder resolves the MSYS2 root via WindowsConfig.msys2Path, then the MSYS2_ROOT environment variable, then well-known install locations, and passes -DCMAKE_C(XX)_COMPILER=<msys2>\ucrt64\bin\ clang(++).exe. The <msys2>\ucrt64\bin directory is added to PATH for the CMake process.
  • With WindowsConfig.staticRuntime (default true) the C++ runtime (libgcc / libstdc++ / winpthread) is statically linked into the DLL, producing a self-contained DLL with no MSYS2 runtime DLL dependency.
  • dynamicCrt / bundleCrt do not apply to the MSVC CRT (no MSVC CRT dependency).
msys2Gcc → const WindowsCompiler

MSYS2 ucrt64 gcc/g++ — the GNU/MinGW-style GCC toolchain (x86_64-w64-windows-gnu target), e.g. from the mingw-w64-ucrt-x86_64-gcc package.

Same model as msys2Clang (GNU ABI, self-contained toolchain, Ninja only, WindowsConfig.msys2Path / MSYS2_ROOT / well-known install locations for resolution, -DCMAKE_C(XX)_COMPILER=<msys2>\ucrt64\bin\ gcc(++).exe), and statically links the C++ runtime by default via WindowsConfig.staticRuntime.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<WindowsCompiler>
A constant List of the values in this enum, in order of their declaration.