From 625576796ce2547cf545facda5dc0e13410c7500 Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Fri, 9 Jul 2021 14:14:39 +0000 Subject: [PATCH] final fix --- cmake/find/s2geometry.cmake | 10 +++++++--- contrib/s2geometry-cmake/CMakeLists.txt | 2 ++ docs/en/development/contrib.md | 1 + src/Functions/geoToS2.cpp | 1 - 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmake/find/s2geometry.cmake b/cmake/find/s2geometry.cmake index 01b106b15c8..2364c6ba193 100644 --- a/cmake/find/s2geometry.cmake +++ b/cmake/find/s2geometry.cmake @@ -7,9 +7,13 @@ if (ENABLE_S2_GEOMETRY) set (ENABLE_S2_GEOMETRY 0) set (USE_S2_GEOMETRY 0) else() - set (S2_GEOMETRY_LIBRARY s2) - set (S2_GEOMETRY_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/s2geometry/src/s2) - set (USE_S2_GEOMETRY 1) + if (OPENSSL_FOUND) + set (S2_GEOMETRY_LIBRARY s2) + set (S2_GEOMETRY_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/s2geometry/src/s2) + set (USE_S2_GEOMETRY 1) + else() + message (WARNING "S2 uses OpenSSL, but the latter is absent.") + endif() endif() if (NOT USE_S2_GEOMETRY) diff --git a/contrib/s2geometry-cmake/CMakeLists.txt b/contrib/s2geometry-cmake/CMakeLists.txt index d23dc14197b..f54562652a6 100644 --- a/contrib/s2geometry-cmake/CMakeLists.txt +++ b/contrib/s2geometry-cmake/CMakeLists.txt @@ -90,6 +90,8 @@ set(S2_SRCS "${S2_SOURCE_DIR}/s2/s2wedge_relations.cc" "${S2_SOURCE_DIR}/s2/strings/ostringstream.cc" "${S2_SOURCE_DIR}/s2/strings/serialize.cc" + # ClickHouse doesn't use strings from abseil. + # So, there is no duplicate symbols. "${S2_SOURCE_DIR}/s2/third_party/absl/base/dynamic_annotations.cc" "${S2_SOURCE_DIR}/s2/third_party/absl/base/internal/raw_logging.cc" "${S2_SOURCE_DIR}/s2/third_party/absl/base/internal/throw_delegate.cc" diff --git a/docs/en/development/contrib.md b/docs/en/development/contrib.md index ac39c496c72..a65ddb40af0 100644 --- a/docs/en/development/contrib.md +++ b/docs/en/development/contrib.md @@ -79,6 +79,7 @@ SELECT library_name, license_type, license_path FROM system.licenses ORDER BY li | re2 | BSD 3-clause | /contrib/re2/LICENSE | | replxx | BSD 3-clause | /contrib/replxx/LICENSE.md | | rocksdb | BSD 3-clause | /contrib/rocksdb/LICENSE.leveldb | +| s2geometry | Apache | /contrib/s2geometry/LICENSE | | sentry-native | MIT | /contrib/sentry-native/LICENSE | | simdjson | Apache | /contrib/simdjson/LICENSE | | snappy | Public Domain | /contrib/snappy/COPYING | diff --git a/src/Functions/geoToS2.cpp b/src/Functions/geoToS2.cpp index 1458a5d9eb0..394b670a4c4 100644 --- a/src/Functions/geoToS2.cpp +++ b/src/Functions/geoToS2.cpp @@ -21,7 +21,6 @@ namespace DB namespace ErrorCodes { extern const int ILLEGAL_TYPE_OF_ARGUMENT; - extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; } namespace