The header TargetRegistry.h has moved in LLVM/clang 14. Committer notes: The problem as noticed when building in ubuntu:22.04: 90 98.61 ubuntu:22.04 : FAIL gcc version 11.2.0 (Ubuntu 11.2.0-19ubuntu1) util/c++/clang.cpp:23:10: fatal error: llvm/Support/TargetRegistry.h: No such file or directory 23 | #include "llvm/Support/TargetRegistry.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. Fixed after applying this patch.
Unified · Split
| @@ -20,7 +20,11 @@ · 19 unmodified lines | ||
| 20 | 20 | #include "llvm/Option/Option.h" |
| 21 | 21 | #include "llvm/Support/FileSystem.h" |
| 22 | 22 | #include "llvm/Support/ManagedStatic.h" |
| 23 | +#if CLANG_VERSION_MAJOR >= 14 | |
| 24 | +#include "llvm/MC/TargetRegistry.h" | |
| 25 | +#else | |
| 23 | 26 | #include "llvm/Support/TargetRegistry.h" |
| 27 | +#endif | |
| 24 | 28 | #include "llvm/Support/TargetSelect.h" |
| 25 | 29 | #include "llvm/Target/TargetMachine.h" |
| 26 | 30 | #include "llvm/Target/TargetOptions.h" |