Commit 467b6554 authored by Tor Didriksen's avatar Tor Didriksen

Bug#14300733 CMAKE DOES NOT CHECK FOR ZLIB VERSION

Add check for compressBound() and deflateBound()
Keep existing functionality: fallback to bundled zlib if functions not found.
parent 80da65a1
...@@ -57,13 +57,17 @@ MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS) ...@@ -57,13 +57,17 @@ MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS)
INCLUDE(CheckFunctionExists) INCLUDE(CheckFunctionExists)
SET(CMAKE_REQUIRED_LIBRARIES z) SET(CMAKE_REQUIRED_LIBRARIES z)
CHECK_FUNCTION_EXISTS(crc32 HAVE_CRC32) CHECK_FUNCTION_EXISTS(crc32 HAVE_CRC32)
CHECK_FUNCTION_EXISTS(compressBound HAVE_COMPRESSBOUND)
CHECK_FUNCTION_EXISTS(deflateBound HAVE_DEFLATEBOUND)
SET(CMAKE_REQUIRED_LIBRARIES) SET(CMAKE_REQUIRED_LIBRARIES)
IF(HAVE_CRC32) IF(HAVE_CRC32 AND HAVE_COMPRESSBOUND AND HAVE_DEFLATEBOUND)
SET(ZLIB_LIBRARY z CACHE INTERNAL "System zlib library") SET(ZLIB_LIBRARY z CACHE INTERNAL "System zlib library")
SET(WITH_ZLIB "system" CACHE STRING "Which zlib to use (possible values are 'bundled' or 'system')") SET(WITH_ZLIB "system" CACHE STRING
"Which zlib to use (possible values are 'bundled' or 'system')")
SET(ZLIB_SOURCES "") SET(ZLIB_SOURCES "")
ELSE() ELSE()
SET(ZLIB_FOUND FALSE CACHE INTERNAL "Zlib found but not usable") SET(ZLIB_FOUND FALSE CACHE INTERNAL "Zlib found but not usable")
MESSAGE(STATUS "system zlib found but not usable")
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(NOT ZLIB_FOUND) IF(NOT ZLIB_FOUND)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment