小编Hor*_*tur的帖子

构建llvm ClangTool

我设法建立了llvm和clang,现在我正在尝试根据clang docs创建一个ClangTool .但是当我尝试构建它时,我收到以下错误:

CMake Error at tools/clang/tools/loop-convert/CMakeLists.txt:6 (target_link_libraries):
  The keyword signature for target_link_libraries has already been used with 
  the target "loop-convert".  All uses of target_link_libraries with a target
  must be either all-keyword or all-plain.

  The uses of the keyword signature are here:

    * cmake/modules/LLVM-Config.cmake:105 (target_link_libraries)
    * cmake/modules/AddLLVM.cmake:771 (target_link_libraries)
Run Code Online (Sandbox Code Playgroud)

我目前的CMakeLists.txt是:

set(LLVM_LINK_COMPONENTS support)

add_clang_executable(loop-convert
  LoopConvert.cpp
)

target_link_libraries(loop-convert
  clangTooling
  clangBasic
  clangASTMatchers
)
Run Code Online (Sandbox Code Playgroud)

c++ cmake llvm clang

9
推荐指数
1
解决办法
1263
查看次数

标签 统计

c++ ×1

clang ×1

cmake ×1

llvm ×1