Remove unbundled simdjson support

This commit is contained in:
Azat Khuzhin 2022-01-17 22:29:50 +03:00
parent 4524a19391
commit db468b6fae
7 changed files with 20 additions and 22 deletions

View File

@ -505,7 +505,6 @@ include (cmake/find/curl.cmake)
include (cmake/find/s3.cmake)
include (cmake/find/blob_storage.cmake)
include (cmake/find/base64.cmake)
include (cmake/find/simdjson.cmake)
include (cmake/find/fast_float.cmake)
include (cmake/find/rapidjson.cmake)
include (cmake/find/fastops.cmake)

View File

@ -1,11 +0,0 @@
option (USE_SIMDJSON "Use simdjson" ${ENABLE_LIBRARIES})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/simdjson/include/simdjson.h")
message (WARNING "submodule contrib/simdjson is missing. to fix try run: \n git submodule update --init")
if (USE_SIMDJSON)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal simdjson library")
endif()
return()
endif ()
message(STATUS "Using simdjson=${USE_SIMDJSON}")

View File

@ -141,9 +141,7 @@ if (USE_BASE64)
add_subdirectory (base64-cmake)
endif()
if (USE_SIMDJSON)
add_subdirectory (simdjson-cmake)
endif()
if (USE_FASTOPS)
add_subdirectory (fastops-cmake)

View File

@ -1,11 +1,20 @@
option (ENABLE_SIMDJSON "Use simdjson" ${ENABLE_LIBRARIES})
if (NOT ENABLE_SIMDJSON)
message(STATUS "Not using simdjson")
return()
endif()
set(SIMDJSON_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/simdjson/include")
set(SIMDJSON_SRC_DIR "${ClickHouse_SOURCE_DIR}/contrib/simdjson/src")
set(SIMDJSON_SRC "${SIMDJSON_SRC_DIR}/simdjson.cpp")
add_library(simdjson ${SIMDJSON_SRC})
target_include_directories(simdjson SYSTEM PUBLIC "${SIMDJSON_INCLUDE_DIR}" PRIVATE "${SIMDJSON_SRC_DIR}")
add_library(_simdjson ${SIMDJSON_SRC})
target_include_directories(_simdjson SYSTEM PUBLIC "${SIMDJSON_INCLUDE_DIR}" PRIVATE "${SIMDJSON_SRC_DIR}")
# simdjson is using its own CPU dispatching and get confused if we enable AVX/AVX2 flags.
if(ARCH_AMD64)
target_compile_options(simdjson PRIVATE -mno-avx -mno-avx2)
target_compile_options(_simdjson PRIVATE -mno-avx -mno-avx2)
endif()
add_library(ch_contrib::simdjson ALIAS _simdjson)

View File

@ -504,8 +504,8 @@ if (TARGET ch_contrib::bzip2)
target_link_libraries (clickhouse_common_io PRIVATE ch_contrib::bzip2)
endif()
if(USE_SIMDJSON)
dbms_target_link_libraries(PRIVATE simdjson)
if (TARGET ch_contrib::simdjson)
dbms_target_link_libraries(PRIVATE ch_contrib::simdjson)
endif()
if(USE_RAPIDJSON)

View File

@ -85,8 +85,8 @@ endif()
target_link_libraries(clickhouse_functions PRIVATE hyperscan)
if(USE_SIMDJSON)
target_link_libraries(clickhouse_functions PRIVATE simdjson)
if (TARGET ch_contrib::simdjson)
target_link_libraries(clickhouse_functions PRIVATE ch_contrib::simdjson)
endif()
if(USE_RAPIDJSON)

View File

@ -34,3 +34,6 @@ endif()
if (TARGET ch_contrib::icu)
set(USE_ICU 1)
endif()
if (TARGET ch_contrib::simdjson)
set(USE_SIMDJSON 1)
endif()