summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-12-05 10:24:15 +0000
committerPavel Labath <labath@google.com>2017-12-05 10:24:15 +0000
commit2da3397cdfd22be99e5752c18f0bbd0f75970acc (patch)
treefba4b7ebfdd9e0f47b7ad383ee3b84cb39c0f43d /llvm/lib/Support
parentf91f0b0af790043956e9224564844f7545579cb7 (diff)
downloadbcm5719-llvm-2da3397cdfd22be99e5752c18f0bbd0f75970acc.tar.gz
bcm5719-llvm-2da3397cdfd22be99e5752c18f0bbd0f75970acc.zip
Re-commit "[cmake] Enable zlib support on windows"
This recommits r319533 which was broken llvm-config --system-libs output. The reason was that I used find_libraries for searching for the z library. This returns absolute paths, and when these paths made it into llvm-config, it made it produce nonsensical flags. To fix this, I hand-roll a search for the library in the same way that we search for the terminfo library a couple of lines below. This is a bit less flexible than the find_library option, as it does not allow the user to specify the path to the library at configure time (which is important on windows, as zlib is unlikely to be found in any of the standard places cmake searches), but I was able to guide the build to find it with appropriate values of LIB and INCLUDE environment variables. Reviewers: compnerd, rnk, beanz, rafael Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D40779 llvm-svn: 319751
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/CMakeLists.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index 5d95a9a9a56..5723f8fcf5b 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -1,4 +1,7 @@
set(system_libs)
+if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
+ set(system_libs ${system_libs} ${ZLIB_LIBRARIES})
+endif()
if( MSVC OR MINGW )
# libuuid required for FOLDERID_Profile usage in lib/Support/Windows/Path.inc.
set(system_libs ${system_libs} psapi shell32 ole32 uuid)
@@ -21,9 +24,6 @@ elseif( CMAKE_HOST_UNIX )
set(system_libs ${system_libs} atomic)
endif()
set(system_libs ${system_libs} ${LLVM_PTHREAD_LIB})
- if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
- set(system_libs ${system_libs} z)
- endif()
if( UNIX AND NOT (BEOS OR HAIKU) )
set(system_libs ${system_libs} m)
endif()
OpenPOWER on IntegriCloud