[PATCH] D39002: [cmake] Use find_package to discover zlib

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 17 11:02:14 PDT 2017


beanz requested changes to this revision.
beanz added inline comments.
This revision now requires changes to proceed.


================
Comment at: interpreter/CMakeLists.txt:27
+  set(ZLIB_LIBRARY ${CMAKE_BINARY_DIR}/lib/libZLIB.a CACHE BOOL "" FORCE)
+endif()
+
----------------
This shouldn't be here.


================
Comment at: interpreter/llvm/src/lib/Support/CMakeLists.txt:25
   if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
-    set(system_libs ${system_libs} z)
+    set(system_libs ${system_libs} ${ZLIB_LIBRARY})
   endif()
----------------
The correct variable to use here is `ZLIB_LIBRARIES`. While `ZLIB_LIBRARY` probably works in most cases, it is an implementation detail of the FindZLIB CMake package.


Repository:
  rL LLVM

https://reviews.llvm.org/D39002





More information about the llvm-commits mailing list