diff options
| author | Michal Gorny <mgorny@gentoo.org> | 2016-11-01 20:31:52 +0000 |
|---|---|---|
| committer | Michal Gorny <mgorny@gentoo.org> | 2016-11-01 20:31:52 +0000 |
| commit | f77a9889c08124dbf27d883100008f3b1c09962b (patch) | |
| tree | 5903fbce540950416c9c60ec128ad8e73dfcd719 /clang/test | |
| parent | 6dc7fcbec428fbc15be90bb9ff942f93752e04c1 (diff) | |
| download | bcm5719-llvm-f77a9889c08124dbf27d883100008f3b1c09962b.tar.gz bcm5719-llvm-f77a9889c08124dbf27d883100008f3b1c09962b.zip | |
[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
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CMakeLists.txt b/clang/test/CMakeLists.txt index 9d989cdb8eb..8ba9040a92a 100644 --- a/clang/test/CMakeLists.txt +++ b/clang/test/CMakeLists.txt @@ -9,6 +9,15 @@ endif () string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) +if(CLANG_BUILT_STANDALONE) + # Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This + # value is forced to 0 if zlib was not found, so it is fine to use it + # instead of HAVE_LIBZ (not recorded). + if(LLVM_ENABLE_ZLIB) + set(HAVE_LIBZ 1) + endif() +endif() + configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |

