llvm.org GIT mirror llvm / 1c1c256
[cmake] Use find_package to discover zlib This allows us to use standard cmake utilities to point to non-system zlib locations. Patch by Oksana Shadura and me (D39002). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316025 91177308-0d34-0410-b5e6-96231b3b80d8 Vassil Vassilev 1 year, 11 months ago
2 changed file(s) with 5 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
131131 # like strlen, leading to false positives.
132132 if( NOT PURE_WINDOWS AND NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
133133 if (LLVM_ENABLE_ZLIB)
134 check_library_exists(z compress2 "" HAVE_LIBZ)
134 find_package(ZLIB REQUIRED)
135 if (ZLIB_FOUND)
136 set(HAVE_LIBZ 1)
137 endif()
135138 else()
136139 set(HAVE_LIBZ 0)
137140 endif()
2121 endif()
2222 set(system_libs ${system_libs} ${LLVM_PTHREAD_LIB})
2323 if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
24 set(system_libs ${system_libs} z)
24 set(system_libs ${system_libs} ${ZLIB_LIBRARIES})
2525 endif()
2626 if( UNIX AND NOT (BEOS OR HAIKU) )
2727 set(system_libs ${system_libs} m)