From 9a1d16b55324056e4d5031370b007097b76dc519 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 26 Jun 2017 18:48:01 -0700 Subject: Don't check for inflatePrime() on Windows. On Windows, we build libz as part of the Wireshark build process, so we don't necessarily *have* a libz library to search or inflatePrime() at this point; the search fails on the buildbots, for example. So, on Windows, we just assume we have a new enough version of libz, so that it has inflatePrime(). Bug: 13850 Change-Id: Ied0909f4a591ff3312d83a2a2ed41e3cd12218e8 Reviewed-on: https://code.wireshark.org/review/22413 Petri-Dish: Guy Harris Reviewed-by: Guy Harris --- cmake/modules/FindZLIB.cmake | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/cmake/modules/FindZLIB.cmake b/cmake/modules/FindZLIB.cmake index 212867e769..ac4259b984 100644 --- a/cmake/modules/FindZLIB.cmake +++ b/cmake/modules/FindZLIB.cmake @@ -87,11 +87,25 @@ IF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") SET(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}") ENDIF() -INCLUDE(CheckFunctionExists) -SET(CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARY}) -CHECK_FUNCTION_EXISTS("inflatePrime" HAVE_INFLATEPRIME) -# reset -SET(CMAKE_REQUIRED_LIBRARIES "") +# +# Sigh. On Windows, we build libz as part of the Wireshark build +# process, so we don't necessarily *have* a libz library to search +# for inflatePrime() at this point; the search fails on the buildbots, +# for example. See bug 13850. +# +# So, on Windows, we just assume we have a new enough version of +# libz, so that it has inflatePrime(). +# +IF(WIN32) + MESSAGE(STATUS "Zlib might not be built yet; assume it contains inflatePrime") + SET(HAVE_INFLATEPRIME ON) +ELSE() + INCLUDE(CheckFunctionExists) + SET(CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARY}) + CHECK_FUNCTION_EXISTS("inflatePrime" HAVE_INFLATEPRIME) + # reset + SET(CMAKE_REQUIRED_LIBRARIES "") +ENDIF() # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if # all listed variables are TRUE -- cgit v1.2.1