[test] Fix detecting LLVM zlib support in stand-alone builds
authorMichal Gorny <mgorny@gentoo.org>
Tue, 1 Nov 2016 20:31:52 +0000 (20:31 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Tue, 1 Nov 2016 20:31:52 +0000 (20:31 +0000)
commitf77a9889c08124dbf27d883100008f3b1c09962b
tree5903fbce540950416c9c60ec128ad8e73dfcd719
parent6dc7fcbec428fbc15be90bb9ff942f93752e04c1
[test] Fix detecting LLVM zlib support in stand-alone builds

Fix the test run to declare missing HAVE_LIBZ value in stand-alone
builds, using the LLVM_ENABLE_ZLIB that is exported in LLVMConfig.cmake.

When using in-tree builds, HAVE_LIBZ is declared in
cmake/config-ix.cmake as a result of LLVM's CMake checks. When building
stand-alone, this value is not available and as a result caused clang to
wrongly assume that LLVM was built without zlib support.

To fix it, set it to the value of LLVM_ENABLE_ZLIB. While this variable
is originally used to control the user preference, LLVM updates its
value to 0 if zlib checks fail. Therefore, we can use it to reliably
determine whether LLVM was built with zlib support or not.

Differential Revision: https://reviews.llvm.org/D24869

llvm-svn: 285741
clang/test/CMakeLists.txt