Remove unbundled yaml-cpp support

This commit is contained in:
Azat Khuzhin 2022-01-18 00:23:14 +03:00
parent dea90967cf
commit 592bc1e97d
6 changed files with 45 additions and 48 deletions

View File

@ -497,7 +497,6 @@ include (cmake/find/miniselect.cmake)
include (cmake/find/curl.cmake) include (cmake/find/curl.cmake)
include (cmake/find/s3.cmake) include (cmake/find/s3.cmake)
include (cmake/find/libpqxx.cmake) include (cmake/find/libpqxx.cmake)
include (cmake/find/yaml-cpp.cmake)
include (cmake/find/nlp.cmake) include (cmake/find/nlp.cmake)
include (cmake/find/filelog.cmake) include (cmake/find/filelog.cmake)
include (cmake/find/sentry.cmake) include (cmake/find/sentry.cmake)

View File

@ -1,9 +0,0 @@
option(USE_YAML_CPP "Enable yaml-cpp" ${ENABLE_LIBRARIES})
if (NOT USE_YAML_CPP)
return()
endif()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/yaml-cpp/README.md")
message (ERROR "submodule contrib/yaml-cpp is missing. to fix try run: \n git submodule update --init")
endif()

View File

@ -39,11 +39,7 @@ add_subdirectory (replxx-cmake)
add_subdirectory (unixodbc-cmake) add_subdirectory (unixodbc-cmake)
add_subdirectory (nanodbc-cmake) add_subdirectory (nanodbc-cmake)
add_subdirectory (capnproto-cmake) add_subdirectory (capnproto-cmake)
add_subdirectory (yaml-cpp-cmake)
if (USE_YAML_CPP)
add_subdirectory (yaml-cpp-cmake)
endif()
add_subdirectory (re2-cmake) add_subdirectory (re2-cmake)
add_subdirectory (xz-cmake) add_subdirectory (xz-cmake)
add_subdirectory (brotli-cmake) add_subdirectory (brotli-cmake)

View File

@ -1,3 +1,10 @@
option(ENABLE_YAML_CPP "Enable yaml-cpp" ${ENABLE_LIBRARIES})
if (NOT ENABLE_YAML_CPP)
message(STATUS "Not using yaml")
return()
endif()
set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/yaml-cpp) set (LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/yaml-cpp)
set (SRCS set (SRCS
@ -34,6 +41,7 @@ set (SRCS
add_library (yaml-cpp ${SRCS}) add_library (yaml-cpp ${SRCS})
target_include_directories(yaml-cpp PRIVATE ${LIBRARY_DIR}/include/yaml-cpp) target_include_directories(yaml-cpp PRIVATE ${LIBRARY_DIR}/include/yaml-cpp)
target_include_directories(yaml-cpp SYSTEM BEFORE PUBLIC ${LIBRARY_DIR}/include) target_include_directories(yaml-cpp SYSTEM BEFORE PUBLIC ${LIBRARY_DIR}/include)
add_library (ch_contrib::yaml_cpp ALIAS yaml-cpp)

View File

@ -27,7 +27,7 @@ target_link_libraries(clickhouse_common_config_no_zookeeper_log
string_utils string_utils
) )
if (USE_YAML_CPP) if (TARGET ch_contrib::yaml_cpp)
target_link_libraries(clickhouse_common_config PRIVATE yaml-cpp) target_link_libraries(clickhouse_common_config PRIVATE ch_contrib::yaml_cpp)
target_link_libraries(clickhouse_common_config_no_zookeeper_log PRIVATE yaml-cpp) target_link_libraries(clickhouse_common_config_no_zookeeper_log PRIVATE ch_contrib::yaml_cpp)
endif() endif()

View File

@ -52,6 +52,9 @@ endif()
if (TARGET ch_contrib::base64) if (TARGET ch_contrib::base64)
set(USE_BASE64 1) set(USE_BASE64 1)
endif() endif()
if (TARGET ch_contrib::yaml_cpp)
set(USE_YAML_CPP 1)
endif()
if (TARGET ch_contrib::sqlite) if (TARGET ch_contrib::sqlite)
set(USE_SQLITE 1) set(USE_SQLITE 1)
endif() endif()