cmake/配置-ix.cmake :401 (get_host_triple) error when trying to build LLVM with CMake on Windows

标签 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)

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

最佳答案

我有同样的问题并通过手动添加此行作为构建选项来解决:

-DLLVM_HOST_TRIPLE=x86_64

关于cmake/配置-ix.cmake :401 (get_host_triple) error when trying to build LLVM with CMake on Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66087509/

相关文章:

Cmake 正在将某些内容安装到/usr/local/include 和/usr/lib 而不是/usr/include

cmake - 如何在cmake中的宏中定义函数

LLVM、-fprofile-instr-generate、对“__llvm_profile_register_function”的 undefined reference

g++ - 与包含 Flex 和 Bison 的项目链接 LLVM 时遇到问题

c++ - 用户提供我可以在 LLVM Pass 中解析的 LLVM 指令集的简洁方法

c++ - 程序加载/执行

cmake - 如何进行并行 CMake ExternalProject 构建

android - 从 Android Studio/CMake 中的子模块导入自己的本地共享库

c++ - "cord"Boehm GC自带库导致 undefined reference 错误

c++ - 使用 llvm::Linker 以编程方式查找未解析的外部对象