From 592bc1e97d80ab94b33b62e90c753a26355c2e36 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 18 Jan 2022 00:23:14 +0300 Subject: [PATCH] Remove unbundled yaml-cpp support --- CMakeLists.txt | 1 - cmake/find/yaml-cpp.cmake | 9 ---- contrib/CMakeLists.txt | 6 +-- contrib/yaml-cpp-cmake/CMakeLists.txt | 68 +++++++++++++++------------ src/Common/Config/CMakeLists.txt | 6 +-- src/configure_config.cmake | 3 ++ 6 files changed, 45 insertions(+), 48 deletions(-) delete mode 100644 cmake/find/yaml-cpp.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index b665865c50e..400dbcb6a6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -497,7 +497,6 @@ include (cmake/find/miniselect.cmake) include (cmake/find/curl.cmake) include (cmake/find/s3.cmake) include (cmake/find/libpqxx.cmake) -include (cmake/find/yaml-cpp.cmake) include (cmake/find/nlp.cmake) include (cmake/find/filelog.cmake) include (cmake/find/sentry.cmake) diff --git a/cmake/find/yaml-cpp.cmake b/cmake/find/yaml-cpp.cmake deleted file mode 100644 index 2aba6808e31..00000000000 --- a/cmake/find/yaml-cpp.cmake +++ /dev/null @@ -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() diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index fe75d9623f4..6153d2be47e 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -39,11 +39,7 @@ add_subdirectory (replxx-cmake) add_subdirectory (unixodbc-cmake) add_subdirectory (nanodbc-cmake) add_subdirectory (capnproto-cmake) - -if (USE_YAML_CPP) - add_subdirectory (yaml-cpp-cmake) -endif() - +add_subdirectory (yaml-cpp-cmake) add_subdirectory (re2-cmake) add_subdirectory (xz-cmake) add_subdirectory (brotli-cmake) diff --git a/contrib/yaml-cpp-cmake/CMakeLists.txt b/contrib/yaml-cpp-cmake/CMakeLists.txt index ed0287de110..1681bfe4015 100644 --- a/contrib/yaml-cpp-cmake/CMakeLists.txt +++ b/contrib/yaml-cpp-cmake/CMakeLists.txt @@ -1,39 +1,47 @@ +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 (SRCS - ${LIBRARY_DIR}/src/binary.cpp - ${LIBRARY_DIR}/src/emitterutils.cpp - ${LIBRARY_DIR}/src/null.cpp - ${LIBRARY_DIR}/src/scantoken.cpp - ${LIBRARY_DIR}/src/convert.cpp - ${LIBRARY_DIR}/src/exceptions.cpp - ${LIBRARY_DIR}/src/ostream_wrapper.cpp - ${LIBRARY_DIR}/src/simplekey.cpp - ${LIBRARY_DIR}/src/depthguard.cpp - ${LIBRARY_DIR}/src/exp.cpp - ${LIBRARY_DIR}/src/parse.cpp - ${LIBRARY_DIR}/src/singledocparser.cpp - ${LIBRARY_DIR}/src/directives.cpp - ${LIBRARY_DIR}/src/memory.cpp - ${LIBRARY_DIR}/src/parser.cpp - ${LIBRARY_DIR}/src/stream.cpp - ${LIBRARY_DIR}/src/emit.cpp - ${LIBRARY_DIR}/src/nodebuilder.cpp - ${LIBRARY_DIR}/src/regex_yaml.cpp - ${LIBRARY_DIR}/src/tag.cpp - ${LIBRARY_DIR}/src/emitfromevents.cpp - ${LIBRARY_DIR}/src/node.cpp - ${LIBRARY_DIR}/src/scanner.cpp - ${LIBRARY_DIR}/src/emitter.cpp - ${LIBRARY_DIR}/src/node_data.cpp - ${LIBRARY_DIR}/src/scanscalar.cpp - ${LIBRARY_DIR}/src/emitterstate.cpp - ${LIBRARY_DIR}/src/nodeevents.cpp - ${LIBRARY_DIR}/src/scantag.cpp + ${LIBRARY_DIR}/src/binary.cpp + ${LIBRARY_DIR}/src/emitterutils.cpp + ${LIBRARY_DIR}/src/null.cpp + ${LIBRARY_DIR}/src/scantoken.cpp + ${LIBRARY_DIR}/src/convert.cpp + ${LIBRARY_DIR}/src/exceptions.cpp + ${LIBRARY_DIR}/src/ostream_wrapper.cpp + ${LIBRARY_DIR}/src/simplekey.cpp + ${LIBRARY_DIR}/src/depthguard.cpp + ${LIBRARY_DIR}/src/exp.cpp + ${LIBRARY_DIR}/src/parse.cpp + ${LIBRARY_DIR}/src/singledocparser.cpp + ${LIBRARY_DIR}/src/directives.cpp + ${LIBRARY_DIR}/src/memory.cpp + ${LIBRARY_DIR}/src/parser.cpp + ${LIBRARY_DIR}/src/stream.cpp + ${LIBRARY_DIR}/src/emit.cpp + ${LIBRARY_DIR}/src/nodebuilder.cpp + ${LIBRARY_DIR}/src/regex_yaml.cpp + ${LIBRARY_DIR}/src/tag.cpp + ${LIBRARY_DIR}/src/emitfromevents.cpp + ${LIBRARY_DIR}/src/node.cpp + ${LIBRARY_DIR}/src/scanner.cpp + ${LIBRARY_DIR}/src/emitter.cpp + ${LIBRARY_DIR}/src/node_data.cpp + ${LIBRARY_DIR}/src/scanscalar.cpp + ${LIBRARY_DIR}/src/emitterstate.cpp + ${LIBRARY_DIR}/src/nodeevents.cpp + ${LIBRARY_DIR}/src/scantag.cpp ) add_library (yaml-cpp ${SRCS}) - target_include_directories(yaml-cpp PRIVATE ${LIBRARY_DIR}/include/yaml-cpp) target_include_directories(yaml-cpp SYSTEM BEFORE PUBLIC ${LIBRARY_DIR}/include) + +add_library (ch_contrib::yaml_cpp ALIAS yaml-cpp) diff --git a/src/Common/Config/CMakeLists.txt b/src/Common/Config/CMakeLists.txt index cc41a8b2bb2..ec7bdd10196 100644 --- a/src/Common/Config/CMakeLists.txt +++ b/src/Common/Config/CMakeLists.txt @@ -27,7 +27,7 @@ target_link_libraries(clickhouse_common_config_no_zookeeper_log string_utils ) -if (USE_YAML_CPP) - target_link_libraries(clickhouse_common_config PRIVATE yaml-cpp) - target_link_libraries(clickhouse_common_config_no_zookeeper_log PRIVATE yaml-cpp) +if (TARGET ch_contrib::yaml_cpp) + target_link_libraries(clickhouse_common_config PRIVATE ch_contrib::yaml_cpp) + target_link_libraries(clickhouse_common_config_no_zookeeper_log PRIVATE ch_contrib::yaml_cpp) endif() diff --git a/src/configure_config.cmake b/src/configure_config.cmake index ad1f774d7f5..ea2593f95d2 100644 --- a/src/configure_config.cmake +++ b/src/configure_config.cmake @@ -52,6 +52,9 @@ endif() if (TARGET ch_contrib::base64) set(USE_BASE64 1) endif() +if (TARGET ch_contrib::yaml_cpp) + set(USE_YAML_CPP 1) +endif() if (TARGET ch_contrib::sqlite) set(USE_SQLITE 1) endif()