Skip to content

Error building inside clang source tree #554

@GKxxUCAS

Description

@GKxxUCAS

I followed this page (Building Clang and Working with the Code, On Unix-like Systems) to download and build the clang source tree. The source tree looks just like this one. When building cppinsights inside clang (as mentioned in Readme.md) I encountered the following problems:

  1. The path llvm/tools/clang/tools/extra does not exist. find . -name extra gives only ./llvm/test/tools/llvm-cov/Inputs/sources_specified/extra. I found the directory called clang-tools-extra which seems to be the right place since it contains other tools like clang-tidy and clang-query. Then I cloned cppinsights here and added add_subdirectory(cppinsights) into clang-tools-extra/CMakeLists.txt.
  2. cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -G "Unix Makefiles" ../llvm gives the following error:
CMake Error at cmake/modules/LLVM-Config.cmake:106 (get_target_property):
  get_target_property() called with non-existent target "LLVM_INCLUDE_DIR".
Call Stack (most recent call first):
  cmake/modules/LLVM-Config.cmake:98 (explicit_llvm_config)
  /home/gkxx/install/llvm-project/clang-tools-extra/cppinsights/CMakeLists.txt:442 (llvm_config)

I have no idea how to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions