Open
Description
When importing LLVM 20.1.4 before zstd 1.5.7 (built with CMake) in CMake config mode, CMake throws strange errors,
# Example
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(test LANGUAGES C CXX)
find_package(LLVM CONFIG)
find_package(zstd CONFIG)
-- The C compiler identification is Clang 20.1.4
-- The CXX compiler identification is Clang 20.1.4
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /lib64/cmake/zstd/zstdTargets.cmake:42 (message):
Some (but not all) targets in this export set were already defined.
Targets Defined: zstd::libzstd_shared
Targets not yet defined: zstd::libzstd
Call Stack (most recent call first):
/lib64/cmake/zstd/zstdConfig.cmake:42 (include)
CMakeLists.txt:6 (find_package)
-- Configuring incomplete, errors occurred!
It seems llvm/cmake/modules/Findzstd.cmake
defines only a subset of targets defined in zstdTargets.cmake (only zstd::libzstd_shared but not zstd::libzstd) thus messes zstd's cmake script up, which considers an incomplete importing happens.
Metadata
Metadata
Assignees
Labels
Build system in general and CMake in particularBuild system in general and CMake in particular