Issue |
139666
|
Summary |
Findzstd.cmake conflicts with CMake-generated zstd config module
|
Labels |
new issue
|
Assignees |
|
Reporter |
ziyao233
|
When importing LLVM 20.1.4 before zstd 1.5.7 (built with CMake) in CMake config mode, CMake throws strange errors,
```CMake
# Example
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(test LANGUAGES C CXX)
find_package(zstd CONFIG)
find_package(LLVM 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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs