summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/config-ix.cmake
diff options
context:
space:
mode:
authorJames Henderson <jh7370@my.bristol.ac.uk>2020-01-02 15:35:22 +0000
committerJames Henderson <jh7370@my.bristol.ac.uk>2020-01-02 16:02:10 +0000
commite406cca5f9a6477c9861717f81c156aa83feeaca (patch)
tree59444cab919ea20ae0b9d754093c058fb12c1edb /llvm/cmake/config-ix.cmake
parent34397b75609c09c1723cd6c0b27f8f13c641ce4c (diff)
downloadbcm5719-llvm-e406cca5f9a6477c9861717f81c156aa83feeaca.tar.gz
bcm5719-llvm-e406cca5f9a6477c9861717f81c156aa83feeaca.zip
Revert "build: reduce CMake handling for zlib"
This reverts commit 68a235d07f9e7049c7eb0c8091f37e385327ac28. This commit broke the clang-x64-windows-msvc build bot and a follow-up commit did not fix it. Reverting to fix the bot.
Diffstat (limited to 'llvm/cmake/config-ix.cmake')
-rw-r--r--llvm/cmake/config-ix.cmake19
1 files changed, 16 insertions, 3 deletions
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index d5a15a680a6..e7e5e5dcf2f 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -56,6 +56,7 @@ check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(termios.h HAVE_TERMIOS_H)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(valgrind/valgrind.h HAVE_VALGRIND_VALGRIND_H)
+check_include_file(zlib.h HAVE_ZLIB_H)
check_include_file(fenv.h HAVE_FENV_H)
check_symbol_exists(FE_ALL_EXCEPT "fenv.h" HAVE_DECL_FE_ALL_EXCEPT)
check_symbol_exists(FE_INEXACT "fenv.h" HAVE_DECL_FE_INEXACT)
@@ -117,8 +118,17 @@ endif()
# Don't look for these libraries if we're using MSan, since uninstrumented third
# party code may call MSan interceptors like strlen, leading to false positives.
if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
+ set(HAVE_LIBZ 0)
if(LLVM_ENABLE_ZLIB)
- find_package(ZLIB REQUIRED)
+ foreach(library z zlib_static zlib)
+ string(TOUPPER ${library} library_suffix)
+ check_library_exists(${library} compress2 "" HAVE_LIBZ_${library_suffix})
+ if(HAVE_LIBZ_${library_suffix})
+ set(HAVE_LIBZ 1)
+ set(ZLIB_LIBRARIES "${library}")
+ break()
+ endif()
+ endforeach()
endif()
# Don't look for these libraries on Windows.
@@ -505,8 +515,11 @@ else( LLVM_ENABLE_THREADS )
message(STATUS "Threads disabled.")
endif()
-if(LLVM_ENABLE_ZLIB)
- find_package(ZLIB REQUIRED)
+if (LLVM_ENABLE_ZLIB )
+ # Check if zlib is available in the system.
+ if ( NOT HAVE_ZLIB_H OR NOT HAVE_LIBZ )
+ set(LLVM_ENABLE_ZLIB 0)
+ endif()
endif()
if (LLVM_ENABLE_DOXYGEN)
OpenPOWER on IntegriCloud