繁体   English   中英

在macOS下构建llvm / clang的cmake错误

[英]cmake error building llvm/clang under macOS

当我为llvm / clang运行cmake时,出现以下消息:

-- Performing Test COMPILER_RT_TARGET_HAS_ATOMICS - Success
CMake Error at cmake/modules/AddLLVM.cmake:589 (if):
  if given arguments:

    "LTO" "IN_LIST" "LLVM_DISTRIBUTION_COMPONENTS" "OR" "NOT" "LLVM_DISTRIBUTION_COMPONENTS"

  Unknown arguments specified
Call Stack (most recent call first):
  tools/lto/CMakeLists.txt:19 (add_llvm_library)


-- Configuring incomplete, errors occurred!

这是我正在使用的命令:

cmake -G“ Unix Makefiles” -DCMAKE_BUILD_TYPE =发布-DLLVM_ENABLE_LTO =打开-Wno-dev ..

几个月前,我成功构建了llvm / clang 5.0。 但是今天,我对各个目录和子目录进行了“ git pull ”,以获取最新的更改。

另外,我将cmake更新为3.8.2。 但这没有帮助。

每个评论者的请求都是不带no-dev选项的输出:

-- Performing Test COMPILER_RT_TARGET_HAS_ATOMICS - Success
CMake Warning (dev) at cmake/modules/AddLLVM.cmake:589 (if):
  Policy CMP0057 is not set: Support new IN_LIST if() operator.  Run "cmake
  --help-policy CMP0057" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  IN_LIST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  tools/lto/CMakeLists.txt:19 (add_llvm_library)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at cmake/modules/AddLLVM.cmake:589 (if):
  if given arguments:

    "LTO" "IN_LIST" "LLVM_DISTRIBUTION_COMPONENTS" "OR" "NOT" "LLVM_DISTRIBUTION_COMPONENTS"

  Unknown arguments specified
Call Stack (most recent call first):
  tools/lto/CMakeLists.txt:19 (add_llvm_library)

要在if()表达式中使用IN_LIST运算符,应启用策略CMP0057 从警告消息中可以看出,这不是您的情况。

可以通过cmake_policy(SET)命令启用该策略。 另外,以足够版本(在给定情况下为“ 3.3”)调用的cmake_minimum_required自动启用该策略。

请注意,即使您使用更高版本的CMake,它也不会启用该策略:CMake尊重cmake_minimum_required给出的cmake_minimum_required

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM