Commit f1edee43 authored by David Spickett's avatar David Spickett
Browse files

[llvm][CMake] Improve error message for unknown or experimental targets

Previously you would get this error when passing an experimental target
via LLVM_TARGETS_TO_BUILD:
```
cmake ../llvm-project/llvm -DLLVM_TARGETS_TO_BUILD=M68k -DCMAKE_BU
ILD_TYPE=Release -GNinja

CMake Error at CMakeLists.txt:929 (message):
  The target `M68k' is experimental and must be passed via
  LLVM_EXPERIMENTAL_TARGETS_TO_BUILD
```

Since M68k is a known experimental target, this is helpful. However,
any made up target name would give you the same error.
```
cmake ../llvm-project/llvm -DLLVM_TARGETS_TO_BUILD=NotATarget -DCMAKE_BUILD_TYPE=Release -GNinja

CMake Error at CMakeLists.txt:929 (message):
  The target `NotATarget' is experimental and must be passed via
  LLVM_EXPERIMENTAL_TARGETS_TO_BUILD.
```

We know the set of default targets and in tree experimental targets,
so let's be more specific if we know that it is not an in tree experimental
target:
```
CMake Error at CMakeLists.txt:934 (message):
  The target `NotATarget'...
parent 26ea983d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment