Bug ID 1086444
Summary Clang package misses some CMake targets
Classification openSUSE
Product openSUSE Tumbleweed
Version Current
Hardware Other
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component Development
Assignee bnc-team-screening@forge.provo.novell.com
Reporter marius.kittler@suse.com
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

# Observation
Using Clang's libraries via CMake config files provided by `clang5-devel` leads
to configuration errors.

```
find_package(Clang REQUIRED)
target_link_libraries(some_target PRIVATE clangTooling clangFrontend clangAST
clangLex clangSema clangBasic LLVM)
```

```
CMake Error at generator/CMakeLists.txt:50 (find_package):
  Found package configuration file:

    /usr/lib64/cmake/clang/ClangConfig.cmake

  but it set Clang_FOUND to FALSE so package "Clang" is considered to be NOT
  FOUND.  Reason given by package:

  The following imported targets are referenced, but are missing: clangBasic
  clangCodeGen clangDriver clangFrontend clangFrontendTool
```

Full example:
https://build.opensuse.org/package/live_build_log/home:mkittler/reflective-rapidjson/openSUSE_Tumbleweed/x86_64

# Expected behavior
Of course not configuration error should occur the the target links against the
library correctly.

# Further details
Apparently the concerning libraries are there:
```
pm -ql clang5-devel | grep 'clangBasic'
/usr/lib64/libclangBasic.so

rpm -ql clang5-devel | grep 'clangTooling'
/usr/lib64/libclangTooling.so
/usr/lib64/libclangToolingCore.so
/usr/lib64/libclangToolingRefactor.so
```

So it is just the imported target in the Clang configuration files which is
missing.

Note that the Arch Linux package is working fine so it might be helpful as a
reference: https://www.archlinux.org/packages/testing/x86_64/clang

BTW: Arch Linux is using static libraries for LLVM/Clang 5 but they also
switched to dynamic libraries for LLVM/Clang 6. Their clang 6.0.0 package which
is currently in their staging repo works  fine as well. So the use of dynamic
libs in Tumbleweed is likely not making the difference here.

I think the concerning Tumbleweed spec file is
https://build.opensuse.org/package/show/devel:tools:compiler/llvm. I have been
trying to investigate the issue myself a little bit, but don't know why the
targets are missing so far.

Thanks for your help in advance!


You are receiving this mail because: