mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
LZ4 - fix cmake to include lz4
This commit is contained in:
parent
afad00b7d4
commit
7620c28c14
@ -540,6 +540,7 @@ include (cmake/find/rocksdb.cmake)
|
||||
include (cmake/find/libpqxx.cmake)
|
||||
include (cmake/find/nuraft.cmake)
|
||||
include (cmake/find/yaml-cpp.cmake)
|
||||
include (cmake/find/lz4.cmake)
|
||||
|
||||
if(NOT USE_INTERNAL_PARQUET_LIBRARY)
|
||||
set (ENABLE_ORC OFF CACHE INTERNAL "")
|
||||
|
27
cmake/find/lz4.cmake
Normal file
27
cmake/find/lz4.cmake
Normal file
@ -0,0 +1,27 @@
|
||||
option (USE_LZ4 "Set to FALSE to use system lz4 library instead of bundled" ${NOT_UNBUNDLED})
|
||||
|
||||
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/lz4/lib/lz4.h")
|
||||
if(USE_LZ4)
|
||||
message(WARNING "submodule contrib/lz4 is missing. to fix try run: \n git submodule update --init --recursive")
|
||||
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal lz4 library")
|
||||
set(USE_LZ4 0)
|
||||
endif()
|
||||
set(MISSING_INTERNAL_LZ4_LIBRARY 1)
|
||||
endif()
|
||||
|
||||
if (NOT USE_LZ4)
|
||||
find_library (LZ4_LIBRARY lz4)
|
||||
find_path (LZ4_INCLUDE_DIR NAMES lz4.h PATHS ${LZ4_INCLUDE_PATHS})
|
||||
if (NOT LZ4_LIBRARY OR NOT LZ4_INCLUDE_DIR)
|
||||
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system lz4 library")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (LZ4_LIBRARY AND LZ4_INCLUDE_DIR)
|
||||
elseif (NOT MISSING_INTERNAL_LZ4_LIBRARY)
|
||||
set (USE_LZ4 1)
|
||||
set (LZ4_LIBRARY lz4)
|
||||
set (LZ4_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/lz4/lib)
|
||||
endif ()
|
||||
|
||||
message (STATUS "Using lz4: ${LZ4_INCLUDE_DIR} : ${LZ4_LIBRARY}")
|
@ -27,7 +27,14 @@ if (NOT EXTERNAL_LZ4_LIBRARY_FOUND)
|
||||
"${LIBRARY_DIR}/lib/xxhash.c"
|
||||
)
|
||||
|
||||
add_library (lz4 ${SRCS})
|
||||
set (HEADERS
|
||||
"${LIBRARY_DIR}/lib/lz4.h"
|
||||
"${LIBRARY_DIR}/lib/lz4hc.h"
|
||||
"${LIBRARY_DIR}/lib/lz4frame.h"
|
||||
"${LIBRARY_DIR}/lib/xxhash.h"
|
||||
)
|
||||
|
||||
add_library (lz4 ${SRCS} ${HEADERS})
|
||||
|
||||
target_compile_definitions (lz4 PUBLIC LZ4_DISABLE_DEPRECATE_WARNINGS=1 USE_XXHASH=1)
|
||||
if (SANITIZE STREQUAL "undefined")
|
||||
|
@ -458,6 +458,11 @@ if (USE_DATASKETCHES)
|
||||
target_include_directories (clickhouse_aggregate_functions SYSTEM BEFORE PRIVATE ${DATASKETCHES_INCLUDE_DIR})
|
||||
endif ()
|
||||
|
||||
if (USE_LZ4)
|
||||
target_link_libraries (clickhouse_common_io PRIVATE ${LZ4_LIBRARY})
|
||||
target_include_directories (clickhouse_common_io SYSTEM BEFORE PRIVATE ${LZ4_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
dbms_target_link_libraries(PRIVATE _boost_context)
|
||||
|
||||
include ("${ClickHouse_SOURCE_DIR}/cmake/add_check.cmake")
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <IO/CompressionMethod.h>
|
||||
#include <IO/WriteBuffer.h>
|
||||
|
||||
#include <lz4.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <IO/CompressionMethod.h>
|
||||
#include <IO/ReadBuffer.h>
|
||||
|
||||
#include <lz4.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user