https://bugs.kde.org/show_bug.cgi?id=452125

            Bug ID: 452125
           Summary: Specifying LLVM_DIR causes Clang not to be found.
           Product: kdevelop
           Version: git master
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Build tools: CMake
          Assignee: kdevelop-bugs-n...@kde.org
          Reporter: bunge...@gmail.com
  Target Milestone: ---

SUMMARY
I am on a system where clang-12 is the default but wish to build KDevelop
against clang-13. I can install clang-13 and its dev packages, and set
`cmake-options -DLLVM_DIR=/usr/lib/llvm-13` in my `~/.kdesrc-buildrc`. This
allows llvm-13 to be found, but the cmake build steps fail to find the clang-13
libraries. The issue appears to be that in `cmake/modules/FindClang.cmake` if
`LLVM_DIR` is set `find_package(LLVM ${version})` is not executed at all, which
means that none of its side effects are made available (like setting
(LLVM_FOUND, LLVM_LIBRARY_DIRS, etc). Simply removing `LLVM_DIR OR ` from this
file allows the correct clang-13 libraries to be found and the build succeeds.


STEPS TO REPRODUCE
1. Set `cmake-options -DLLVM_DIR=/usr/lib/llvm-13` in `~/.kdesrc-buildrc`, or
otherwise get LLVM_DIR to CMake.
2. Run CMake.

OBSERVED RESULT
CMake finds LLVM fine, but then fails to find Clang libraries.

EXPECTED RESULT
CMake should find the Clang libraries.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to