2017-02-28 23:49:04 +00:00
|
|
|
option (USE_INTERNAL_ZLIB_LIBRARY "Set to FALSE to use system zlib library instead of bundled" ${NOT_UNBUNDLED})
|
|
|
|
|
2017-02-07 21:28:13 +00:00
|
|
|
if (NOT USE_INTERNAL_ZLIB_LIBRARY)
|
2017-04-01 07:20:54 +00:00
|
|
|
find_package (ZLIB)
|
2017-02-07 21:28:13 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (NOT ZLIB_FOUND)
|
2018-03-02 00:17:25 +00:00
|
|
|
if (NOT MSVC)
|
|
|
|
set (INTERNAL_ZLIB_NAME "zlib-ng")
|
|
|
|
else ()
|
|
|
|
set (INTERNAL_ZLIB_NAME "zlib")
|
|
|
|
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}")
|
|
|
|
message (WARNING "Will use standard zlib, please clone manually:\n git clone https://github.com/madler/zlib.git ${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}")
|
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
set (USE_INTERNAL_ZLIB_LIBRARY 1)
|
2017-11-21 16:18:18 +00:00
|
|
|
set (ZLIB_COMPAT 1) # for zlib-ng, also enables WITH_GZFILEOP
|
2017-11-22 12:15:17 +00:00
|
|
|
set (WITH_NATIVE_INSTRUCTIONS ${ARCHNATIVE})
|
2018-01-20 23:23:19 +00:00
|
|
|
if (ARCH_FREEBSD OR ARCH_I386)
|
2017-11-22 14:03:09 +00:00
|
|
|
set (WITH_OPTIM 0 CACHE INTERNAL "") # Bug in assembler
|
|
|
|
endif ()
|
2017-12-29 15:48:20 +00:00
|
|
|
if (ARCH_AARCH64)
|
|
|
|
set(WITH_NEON 1 CACHE INTERNAL "")
|
|
|
|
set(WITH_ACLE 1 CACHE INTERNAL "")
|
|
|
|
endif ()
|
2018-03-02 00:17:25 +00:00
|
|
|
set (ZLIB_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}" "${ClickHouse_BINARY_DIR}/contrib/${INTERNAL_ZLIB_NAME}") # generated zconf.h
|
2017-10-13 18:58:19 +00:00
|
|
|
set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) # for poco
|
|
|
|
set (ZLIB_FOUND 1) # for poco
|
|
|
|
if (USE_STATIC_LIBRARIES)
|
|
|
|
set (ZLIB_LIBRARIES zlibstatic)
|
|
|
|
else ()
|
|
|
|
set (ZLIB_LIBRARIES zlib)
|
|
|
|
endif ()
|
2017-02-07 21:28:13 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
message (STATUS "Using zlib: ${ZLIB_INCLUDE_DIR} : ${ZLIB_LIBRARIES}")
|