簡體   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