Clang has misconfigured cmake config

REPRODUCIBILITY: Always
OS VERSION: 4.6.0.13
HARDWARE: i486 arch
UI LANGUAGE: CMake
REGRESSION: Not known

DESCRIPTION:

When configuring CMake build that is using /usr/lib/cmake/clang/ClangTargets.cmake, the build fails due to missing /usr/lib/libclangBasic.a .

PRECONDITIONS:

Tested using Docker images simulating Sailfish OS. Should be possible to test on device.

STEPS TO REPRODUCE:

Using either docker-based native builds or on device

  1. zypper in clang-devel
  2. Observe that /usr/lib/cmake/clang/ClangTargets.cmake is installed
  3. In that file, we have add_library(clangBasic STATIC IMPORTED)
  4. When building Qt6 QtTools package, the build fails

EXPECTED RESULT:

File /usr/lib/libclangBasic.a installed

ACTUAL RESULT:

File /usr/lib/libclangBasic.a is missing and, with such cmake config, we get an error:

CMake Error at /usr/lib/cmake/clang/ClangTargets.cmake:779 (message):
  The imported target "clangBasic" references the file

     "/usr/lib/libclangBasic.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib/cmake/clang/ClangTargets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/lib/cmake/clang/ClangConfig.cmake:18 (include)
  cmake/FindWrapLibClang.cmake:17 (find_package)
  /usr/lib/cmake/Qt6/QtFindPackageHelpers.cmake:156 (find_package)
  configure.cmake:20 (qt_find_package)
  /usr/lib/cmake/Qt6/QtFeature.cmake:678 (include)
  src/CMakeLists.txt:18 (qt_feature_evaluate_features)

MODIFICATIONS:

None

ADDITIONAL INFORMATION:

1 Like