mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-11 21:56:15 +00:00
[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
This commit is contained in:
parent
cecf102e0c
commit
1c1c256fbc
@ -132,7 +132,10 @@ endif()
|
||||
# like strlen, leading to false positives.
|
||||
if( NOT PURE_WINDOWS AND NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
|
||||
if (LLVM_ENABLE_ZLIB)
|
||||
check_library_exists(z compress2 "" HAVE_LIBZ)
|
||||
find_package(ZLIB REQUIRED)
|
||||
if (ZLIB_FOUND)
|
||||
set(HAVE_LIBZ 1)
|
||||
endif()
|
||||
else()
|
||||
set(HAVE_LIBZ 0)
|
||||
endif()
|
||||
|
@ -22,7 +22,7 @@ elseif( CMAKE_HOST_UNIX )
|
||||
endif()
|
||||
set(system_libs ${system_libs} ${LLVM_PTHREAD_LIB})
|
||||
if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
|
||||
set(system_libs ${system_libs} z)
|
||||
set(system_libs ${system_libs} ${ZLIB_LIBRARIES})
|
||||
endif()
|
||||
if( UNIX AND NOT (BEOS OR HAIKU) )
|
||||
set(system_libs ${system_libs} m)
|
||||
|
Loading…
Reference in New Issue
Block a user