2021-11-21 10:58:26 +00:00
|
|
|
option (USE_INTERNAL_ZSTD_LIBRARY "Set to FALSE to use system zstd library instead of bundled" ON)
|
2017-02-28 23:49:04 +00:00
|
|
|
|
2019-05-15 17:19:39 +00:00
|
|
|
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/zstd/lib/zstd.h")
|
|
|
|
if(USE_INTERNAL_ZSTD_LIBRARY)
|
2021-10-17 23:29:04 +00:00
|
|
|
message(WARNING "submodule contrib/zstd is missing. to fix try run: \n git submodule update --init")
|
2020-08-14 15:44:04 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal zstd library")
|
|
|
|
set(USE_INTERNAL_ZSTD_LIBRARY 0)
|
2019-05-15 17:19:39 +00:00
|
|
|
endif()
|
|
|
|
set(MISSING_INTERNAL_ZSTD_LIBRARY 1)
|
|
|
|
endif()
|
2017-10-13 18:52:23 +00:00
|
|
|
|
2017-02-28 23:49:04 +00:00
|
|
|
if (NOT USE_INTERNAL_ZSTD_LIBRARY)
|
2017-04-01 07:20:54 +00:00
|
|
|
find_library (ZSTD_LIBRARY zstd)
|
|
|
|
find_path (ZSTD_INCLUDE_DIR NAMES zstd.h PATHS ${ZSTD_INCLUDE_PATHS})
|
2020-08-14 15:44:04 +00:00
|
|
|
if (NOT ZSTD_LIBRARY OR NOT ZSTD_INCLUDE_DIR)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system zstd library")
|
|
|
|
endif ()
|
2017-02-28 23:49:04 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (ZSTD_LIBRARY AND ZSTD_INCLUDE_DIR)
|
2019-05-15 17:19:39 +00:00
|
|
|
elseif (NOT MISSING_INTERNAL_ZSTD_LIBRARY)
|
2017-04-01 07:20:54 +00:00
|
|
|
set (USE_INTERNAL_ZSTD_LIBRARY 1)
|
|
|
|
set (ZSTD_LIBRARY zstd)
|
2019-01-25 12:45:35 +00:00
|
|
|
set (ZSTD_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/zstd/lib)
|
2017-02-28 23:49:04 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
message (STATUS "Using zstd: ${ZSTD_INCLUDE_DIR} : ${ZSTD_LIBRARY}")
|