set(S2_SOURCE_DIR "${ClickHouse_SOURCE_DIR}/contrib/s2geometry/src") set(S2_SRCS "${S2_SOURCE_DIR}/s2/base/stringprintf.cc" "${S2_SOURCE_DIR}/s2/base/strtoint.cc" "${S2_SOURCE_DIR}/s2/encoded_s2cell_id_vector.cc" "${S2_SOURCE_DIR}/s2/encoded_s2point_vector.cc" "${S2_SOURCE_DIR}/s2/encoded_s2shape_index.cc" "${S2_SOURCE_DIR}/s2/encoded_string_vector.cc" "${S2_SOURCE_DIR}/s2/id_set_lexicon.cc" "${S2_SOURCE_DIR}/s2/mutable_s2shape_index.cc" "${S2_SOURCE_DIR}/s2/r2rect.cc" "${S2_SOURCE_DIR}/s2/s1angle.cc" "${S2_SOURCE_DIR}/s2/s1chord_angle.cc" "${S2_SOURCE_DIR}/s2/s1interval.cc" "${S2_SOURCE_DIR}/s2/s2boolean_operation.cc" "${S2_SOURCE_DIR}/s2/s2builder.cc" "${S2_SOURCE_DIR}/s2/s2builder_graph.cc" "${S2_SOURCE_DIR}/s2/s2builderutil_closed_set_normalizer.cc" "${S2_SOURCE_DIR}/s2/s2builderutil_find_polygon_degeneracies.cc" "${S2_SOURCE_DIR}/s2/s2builderutil_lax_polygon_layer.cc" "${S2_SOURCE_DIR}/s2/s2builderutil_s2point_vector_layer.cc" "${S2_SOURCE_DIR}/s2/s2builderutil_s2polygon_layer.cc" "${S2_SOURCE_DIR}/s2/s2builderutil_s2polyline_layer.cc" "${S2_SOURCE_DIR}/s2/s2builderutil_s2polyline_vector_layer.cc" "${S2_SOURCE_DIR}/s2/s2builderutil_snap_functions.cc" "${S2_SOURCE_DIR}/s2/s2cap.cc" "${S2_SOURCE_DIR}/s2/s2cell.cc" "${S2_SOURCE_DIR}/s2/s2cell_id.cc" "${S2_SOURCE_DIR}/s2/s2cell_index.cc" "${S2_SOURCE_DIR}/s2/s2cell_union.cc" "${S2_SOURCE_DIR}/s2/s2centroids.cc" "${S2_SOURCE_DIR}/s2/s2closest_cell_query.cc" "${S2_SOURCE_DIR}/s2/s2closest_edge_query.cc" "${S2_SOURCE_DIR}/s2/s2closest_point_query.cc" "${S2_SOURCE_DIR}/s2/s2contains_vertex_query.cc" "${S2_SOURCE_DIR}/s2/s2convex_hull_query.cc" "${S2_SOURCE_DIR}/s2/s2coords.cc" "${S2_SOURCE_DIR}/s2/s2crossing_edge_query.cc" "${S2_SOURCE_DIR}/s2/s2debug.cc" "${S2_SOURCE_DIR}/s2/s2earth.cc" "${S2_SOURCE_DIR}/s2/s2edge_clipping.cc" "${S2_SOURCE_DIR}/s2/s2edge_crosser.cc" "${S2_SOURCE_DIR}/s2/s2edge_crossings.cc" "${S2_SOURCE_DIR}/s2/s2edge_distances.cc" "${S2_SOURCE_DIR}/s2/s2edge_tessellator.cc" "${S2_SOURCE_DIR}/s2/s2error.cc" "${S2_SOURCE_DIR}/s2/s2furthest_edge_query.cc" "${S2_SOURCE_DIR}/s2/s2latlng.cc" "${S2_SOURCE_DIR}/s2/s2latlng_rect.cc" "${S2_SOURCE_DIR}/s2/s2latlng_rect_bounder.cc" "${S2_SOURCE_DIR}/s2/s2lax_loop_shape.cc" "${S2_SOURCE_DIR}/s2/s2lax_polygon_shape.cc" "${S2_SOURCE_DIR}/s2/s2lax_polyline_shape.cc" "${S2_SOURCE_DIR}/s2/s2loop.cc" "${S2_SOURCE_DIR}/s2/s2loop_measures.cc" "${S2_SOURCE_DIR}/s2/s2measures.cc" "${S2_SOURCE_DIR}/s2/s2metrics.cc" "${S2_SOURCE_DIR}/s2/s2max_distance_targets.cc" "${S2_SOURCE_DIR}/s2/s2min_distance_targets.cc" "${S2_SOURCE_DIR}/s2/s2padded_cell.cc" "${S2_SOURCE_DIR}/s2/s2point_compression.cc" "${S2_SOURCE_DIR}/s2/s2point_region.cc" "${S2_SOURCE_DIR}/s2/s2pointutil.cc" "${S2_SOURCE_DIR}/s2/s2polygon.cc" "${S2_SOURCE_DIR}/s2/s2polyline.cc" "${S2_SOURCE_DIR}/s2/s2polyline_alignment.cc" "${S2_SOURCE_DIR}/s2/s2polyline_measures.cc" "${S2_SOURCE_DIR}/s2/s2polyline_simplifier.cc" "${S2_SOURCE_DIR}/s2/s2predicates.cc" "${S2_SOURCE_DIR}/s2/s2projections.cc" "${S2_SOURCE_DIR}/s2/s2r2rect.cc" "${S2_SOURCE_DIR}/s2/s2region.cc" "${S2_SOURCE_DIR}/s2/s2region_term_indexer.cc" "${S2_SOURCE_DIR}/s2/s2region_coverer.cc" "${S2_SOURCE_DIR}/s2/s2region_intersection.cc" "${S2_SOURCE_DIR}/s2/s2region_union.cc" "${S2_SOURCE_DIR}/s2/s2shape_index.cc" "${S2_SOURCE_DIR}/s2/s2shape_index_buffered_region.cc" "${S2_SOURCE_DIR}/s2/s2shape_index_measures.cc" "${S2_SOURCE_DIR}/s2/s2shape_measures.cc" "${S2_SOURCE_DIR}/s2/s2shapeutil_build_polygon_boundaries.cc" "${S2_SOURCE_DIR}/s2/s2shapeutil_coding.cc" "${S2_SOURCE_DIR}/s2/s2shapeutil_contains_brute_force.cc" "${S2_SOURCE_DIR}/s2/s2shapeutil_edge_iterator.cc" "${S2_SOURCE_DIR}/s2/s2shapeutil_get_reference_point.cc" "${S2_SOURCE_DIR}/s2/s2shapeutil_range_iterator.cc" "${S2_SOURCE_DIR}/s2/s2shapeutil_visit_crossing_edge_pairs.cc" "${S2_SOURCE_DIR}/s2/s2text_format.cc" "${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" "${S2_SOURCE_DIR}/s2/third_party/absl/numeric/int128.cc" "${S2_SOURCE_DIR}/s2/third_party/absl/strings/ascii.cc" "${S2_SOURCE_DIR}/s2/third_party/absl/strings/match.cc" "${S2_SOURCE_DIR}/s2/third_party/absl/strings/numbers.cc" "${S2_SOURCE_DIR}/s2/third_party/absl/strings/str_cat.cc" "${S2_SOURCE_DIR}/s2/third_party/absl/strings/str_split.cc" "${S2_SOURCE_DIR}/s2/third_party/absl/strings/string_view.cc" "${S2_SOURCE_DIR}/s2/third_party/absl/strings/strip.cc" "${S2_SOURCE_DIR}/s2/third_party/absl/strings/internal/memutil.cc" "${S2_SOURCE_DIR}/s2/util/bits/bit-interleave.cc" "${S2_SOURCE_DIR}/s2/util/bits/bits.cc" "${S2_SOURCE_DIR}/s2/util/coding/coder.cc" "${S2_SOURCE_DIR}/s2/util/coding/varint.cc" "${S2_SOURCE_DIR}/s2/util/math/exactfloat/exactfloat.cc" "${S2_SOURCE_DIR}/s2/util/math/mathutil.cc" "${S2_SOURCE_DIR}/s2/util/units/length-units.cc" ) add_library(s2 ${S2_SRCS}) set_property(TARGET s2 PROPERTY CXX_STANDARD 11) if (OPENSSL_FOUND) target_link_libraries(s2 PRIVATE ${OPENSSL_LIBRARIES}) endif() target_include_directories(s2 SYSTEM BEFORE PUBLIC "${S2_SOURCE_DIR}/") if(M_LIBRARY) target_link_libraries(s2 PRIVATE ${M_LIBRARY}) endif()