2022-01-17 05:28:05 +00:00
|
|
|
# lz4 is the main compression method, cannot be disabled.
|
2017-10-13 18:52:23 +00:00
|
|
|
|
2022-01-17 05:28:05 +00:00
|
|
|
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/lz4")
|
|
|
|
set (SRCS
|
|
|
|
"${LIBRARY_DIR}/lib/lz4.c"
|
|
|
|
"${LIBRARY_DIR}/lib/lz4hc.c"
|
|
|
|
"${LIBRARY_DIR}/lib/lz4frame.c"
|
|
|
|
"${LIBRARY_DIR}/lib/xxhash.c"
|
|
|
|
)
|
2020-08-14 15:44:04 +00:00
|
|
|
|
2022-01-17 05:28:05 +00:00
|
|
|
add_library (_lz4 ${SRCS})
|
|
|
|
add_library (ch_contrib::lz4 ALIAS _lz4)
|
2020-08-14 15:44:04 +00:00
|
|
|
|
2022-01-18 06:51:13 +00:00
|
|
|
target_compile_definitions (_lz4 PUBLIC LZ4_DISABLE_DEPRECATE_WARNINGS=1)
|
2023-06-05 13:10:53 +00:00
|
|
|
target_compile_definitions (_lz4 PUBLIC LZ4_FAST_DEC_LOOP=1)
|
2022-01-17 05:28:05 +00:00
|
|
|
if (SANITIZE STREQUAL "undefined")
|
|
|
|
target_compile_options (_lz4 PRIVATE -fno-sanitize=undefined)
|
2020-06-09 10:54:49 +00:00
|
|
|
endif ()
|
2022-01-17 05:28:05 +00:00
|
|
|
target_include_directories(_lz4 PUBLIC "${LIBRARY_DIR}/lib")
|