Bug 1086444 - Clang package misses some CMake targets
Clang package misses some CMake targets
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Development
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: E-mail List
E-mail List
Depends on:
  Show dependency treegraph
Reported: 2018-03-22 10:57 UTC by Marius Kittler
Modified: 2018-05-02 10:01 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Marius Kittler 2018-03-22 10:57:46 UTC
# 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:


  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'

rpm -ql clang5-devel | grep 'clangTooling'

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!
Comment 1 Marius Kittler 2018-05-02 10:01:05 UTC
This is fixed now, eg. https://build.opensuse.org/package/show/home:mkittler/reflective-rapidjson builds now for Tumbleweed.