# CMake Error: The Ninja generator does not support the CXX compiler 'clang++' because it is not a known compiler.

- **ID:** `cmake/generator-ninja-missing-compiler`
- **Domain:** cmake
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 70%

## Root Cause

CMake's Ninja generator has a hardcoded list of supported compilers; if the compiler is not in that list (e.g., a custom build of clang or a different version), CMake rejects it.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| CMake 3.10 | active | — | — |
| CMake 3.16 | active | — | — |
| CMake 3.20 | active | — | — |
| Ninja 1.10 | active | — | — |
| Ninja 1.11 | active | — | — |

## Workarounds

1. **Use the 'Unix Makefiles' generator instead: cmake -G "Unix Makefiles" ..** (90% success)
   ```
   Use the 'Unix Makefiles' generator instead: cmake -G "Unix Makefiles" ..
   ```
2. **Set the CMAKE_GENERATOR to Ninja and also set CMAKE_CXX_COMPILER to a known compiler like g++: cmake -G Ninja -DCMAKE_CXX_COMPILER=g++ ..** (80% success)
   ```
   Set the CMAKE_GENERATOR to Ninja and also set CMAKE_CXX_COMPILER to a known compiler like g++: cmake -G Ninja -DCMAKE_CXX_COMPILER=g++ ..
   ```
3. **Upgrade CMake to a version that supports your compiler. For example, CMake 3.20+ added support for newer clang versions. Check release notes.** (75% success)
   ```
   Upgrade CMake to a version that supports your compiler. For example, CMake 3.20+ added support for newer clang versions. Check release notes.
   ```

## Dead Ends

- **** — If the project requires clang-specific features (e.g., libc++), using g++ may cause compilation errors. (60% fail)
- **** — The issue is not version-specific; CMake's Ninja generator has a whitelist of compiler IDs. Even standard clang may fail if CMake version is old. (70% fail)
- **** — This works but may not preserve Ninja's build speed; also, the project may have Ninja-specific custom commands. (30% fail)
