| Issue |
164629
|
| Summary |
ZLIB can not be configured with zlib-ng config files
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
bebuch
|
https://github.com/llvm/llvm-project/blob/d08cbc1cdd7b73e9a582f5602e8ca4829decab8c/llvm/cmake/config-ix.cmake#L171C1-L182C10
```cmake
if(ZLIB_FOUND)
# Check if zlib we found is usable; for example, we may have found a 32-bit
# library on a 64-bit system which would result in a link-time failure.
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS})
list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARY})
check_symbol_exists(compress2 zlib.h HAVE_ZLIB)
cmake_pop_check_state()
if(LLVM_ENABLE_ZLIB STREQUAL FORCE_ON AND NOT HAVE_ZLIB)
message(FATAL_ERROR "Failed to configure zlib")
endif()
endif()
```
The old CMake ZLIB module variables `ZLIB_INCLUDE_DIRS` and `ZLIB_LIBRARY` are not availiable with modern CMake config files from [zlib-ng](https://github.com/zlib-ng/zlib-ng). If you configure with `CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON` and zlib-ng (in compatebility mode) the configuration fails.
Note that with modern CMake config files there is no need for the check in the first place.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs