尝试在 Windows 上使用 CMake 构建 LLVM 时出现 cmake/config-ix.cmake:401 (get_host_triple) 错误

Vla*_*ach 3 cmake llvm

我想为 Visual Studio Code 设置一个调试器,因此我尝试构建 LLVM 环境,以便在我的计算机上安装 LLDB。但构建失败并显示以下输出:

CMake Warning at cmake/modules/GetHostTriple.cmake:28 (message):
  unable to determine host target triple
Call Stack (most recent call first):
  cmake/config-ix.cmake:401 (get_host_triple)
  CMakeLists.txt:670 (include)
 
 
CMake Error at cmake/config-ix.cmake:409 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  CMakeLists.txt:670 (include)
 
CMake Error at cmake/config-ix.cmake:453 (message):
  Unknown architecture host
Call Stack (most recent call first):
  CMakeLists.txt:670 (include)
Run Code Online (Sandbox Code Playgroud)

我使用 clang v11.0.1、CMake v3.18.0-rc4 和 Ninja v1.10.2。

Cel*_*luk 9

我遇到了同样的问题,并通过手动添加此行作为构建选项来修复:

-DLLVM_HOST_TRIPLE=x86_64
Run Code Online (Sandbox Code Playgroud)