2021-04-24 19:47:52 +00:00
|
|
|
set(LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/croaring")
|
2020-10-23 11:42:21 +00:00
|
|
|
|
|
|
|
set(SRCS
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/src/array_util.c"
|
|
|
|
"${LIBRARY_DIR}/src/bitset_util.c"
|
|
|
|
"${LIBRARY_DIR}/src/containers/array.c"
|
|
|
|
"${LIBRARY_DIR}/src/containers/bitset.c"
|
|
|
|
"${LIBRARY_DIR}/src/containers/containers.c"
|
|
|
|
"${LIBRARY_DIR}/src/containers/convert.c"
|
|
|
|
"${LIBRARY_DIR}/src/containers/mixed_intersection.c"
|
|
|
|
"${LIBRARY_DIR}/src/containers/mixed_union.c"
|
|
|
|
"${LIBRARY_DIR}/src/containers/mixed_equal.c"
|
|
|
|
"${LIBRARY_DIR}/src/containers/mixed_subset.c"
|
|
|
|
"${LIBRARY_DIR}/src/containers/mixed_negation.c"
|
|
|
|
"${LIBRARY_DIR}/src/containers/mixed_xor.c"
|
|
|
|
"${LIBRARY_DIR}/src/containers/mixed_andnot.c"
|
|
|
|
"${LIBRARY_DIR}/src/containers/run.c"
|
|
|
|
"${LIBRARY_DIR}/src/roaring.c"
|
|
|
|
"${LIBRARY_DIR}/src/roaring_priority_queue.c"
|
2023-03-19 03:35:20 +00:00
|
|
|
"${LIBRARY_DIR}/src/roaring_array.c"
|
|
|
|
"${LIBRARY_DIR}/src/memory.c")
|
2020-10-23 11:42:21 +00:00
|
|
|
|
2022-01-20 14:01:49 +00:00
|
|
|
add_library(_roaring ${SRCS})
|
2020-10-23 11:42:21 +00:00
|
|
|
|
2022-01-20 14:01:49 +00:00
|
|
|
target_include_directories(_roaring PRIVATE "${LIBRARY_DIR}/include/roaring")
|
|
|
|
target_include_directories(_roaring SYSTEM BEFORE PUBLIC "${LIBRARY_DIR}/include")
|
|
|
|
target_include_directories(_roaring SYSTEM BEFORE PUBLIC "${LIBRARY_DIR}/cpp")
|
2021-07-21 23:56:17 +00:00
|
|
|
|
2021-08-07 16:30:59 +00:00
|
|
|
# We redirect malloc/free family of functions to different functions that will track memory in ClickHouse.
|
|
|
|
# Also note that we exploit implicit function declarations.
|
2022-01-20 14:01:49 +00:00
|
|
|
target_compile_definitions(_roaring PRIVATE
|
2021-08-16 16:04:12 +00:00
|
|
|
-Dmalloc=clickhouse_malloc
|
|
|
|
-Dcalloc=clickhouse_calloc
|
|
|
|
-Drealloc=clickhouse_realloc
|
|
|
|
-Dreallocarray=clickhouse_reallocarray
|
|
|
|
-Dfree=clickhouse_free
|
|
|
|
-Dposix_memalign=clickhouse_posix_memalign)
|
2021-08-07 16:30:59 +00:00
|
|
|
|
2022-01-20 14:01:49 +00:00
|
|
|
target_link_libraries(_roaring PUBLIC clickhouse_common_io)
|
|
|
|
|
|
|
|
add_library(ch_contrib::roaring ALIAS _roaring)
|