Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
path = thirdparty/arrow/apache-arrow-21.0.0
url = https://github.com/apache/arrow.git
ignore = all
[submodule "thirdparty/CRoaring/CRoaring-2.0.4"]
path = thirdparty/CRoaring/CRoaring-2.0.4
url = https://github.com/RoaringBitmap/CRoaring.git
[submodule "thirdparty/glog/glog-0.5.0"]
path = thirdparty/glog/glog-0.5.0
url = https://github.com/google/glog.git
Expand Down
74 changes: 56 additions & 18 deletions thirdparty/CRoaring/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,62 @@
set(ENABLE_ROARING_TESTS OFF CACHE BOOL "Disable testing in CRoaring" FORCE)
if(MSVC)
set(ROARING_BUILD_STATIC ON CACHE BOOL "" FORCE)
endif()
# CRoaring v2.0.4 - integrated as a single-file amalgamation build.
#
# We deliberately do NOT pull the upstream repository as a git submodule
# anymore: it ships ~292M of benchmarks/test data that we never build, which
# made `git submodule update --init --recursive` painfully slow and bloated
# the local checkout.
#
# Instead, the official amalgamation produced by CRoaring's release pipeline
# (https://github.com/RoaringBitmap/CRoaring/releases/tag/v2.0.4) is checked
# into amalgamation/:
#
# amalgamation/roaring.c - single C TU containing the entire library
# amalgamation/roaring.h - public C API (from official release)
# amalgamation/roaring.hh - public C++ wrapper (from official release)
# amalgamation/roaring64map.hh - 64-bit C++ wrapper (from cpp/ in tarball)
# amalgamation/include/roaring/roaring.h
# - identical to roaring.h, exposed under the
# historical <roaring/roaring.h> path so
# existing callers keep working.
#
# To upgrade, replace these files with the assets from a newer release tag
# (and grab cpp/roaring64map.hh from the source tarball if it is still split).
set(_ROARING_AMAL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/amalgamation)

add_library(roaring STATIC ${_ROARING_AMAL_DIR}/roaring.c)
set_target_properties(roaring PROPERTIES
POSITION_INDEPENDENT_CODE ON
ARCHIVE_OUTPUT_DIRECTORY ${EXTERNAL_LIB_DIR}
)

set(_SAVED_CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${EXTERNAL_LIB_DIR})
add_subdirectory(CRoaring-2.0.4)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${_SAVED_CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
unset(_SAVED_CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
# Two include roots:
# - amalgamation/ -> <roaring.h>, <roaring.hh>, <roaring64map.hh>
# - amalgamation/include/ -> <roaring/roaring.h> (legacy path used in code)
target_include_directories(roaring PUBLIC
$<BUILD_INTERFACE:${_ROARING_AMAL_DIR}>
$<BUILD_INTERFACE:${_ROARING_AMAL_DIR}/include>
)

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(roaring PRIVATE
-Wno-unused-parameter
# The amalgamation is plain C11; the C++ wrappers in roaring.hh require C++11+.
target_compile_features(roaring PUBLIC c_std_11)

# Silence warnings that come from the third-party amalgamation itself; we do
# not want them polluting our build.
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang"
OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
target_compile_options(roaring PRIVATE
-Wno-unused-parameter
-Wno-unused-but-set-variable
-Wno-unused-function
)
endif()

get_target_property(roaring_SOURCE_DIR roaring INTERFACE_SOURCE_DIR)
set(ROARING_FOUND TRUE PARENT_SCOPE)
set(ROARING_INCLUDE_DIR ${roaring_SOURCE_DIR}/include PARENT_SCOPE)
set(ROARING_INCLUDE_DIRS ${roaring_SOURCE_DIR}/include PARENT_SCOPE)
set(ROARING_LIBRARY $<TARGET_FILE:roaring> PARENT_SCOPE)
set(ROARING_LIBRARIES $<TARGET_FILE:roaring> PARENT_SCOPE)
# Preserve the legacy ROARING_* variables so any consumer that still reads
# them (instead of linking the `roaring` target directly) keeps working.
set(ROARING_FOUND TRUE PARENT_SCOPE)
set(ROARING_INCLUDE_DIR ${_ROARING_AMAL_DIR} PARENT_SCOPE)
set(ROARING_INCLUDE_DIRS ${_ROARING_AMAL_DIR}
${_ROARING_AMAL_DIR}/include PARENT_SCOPE)
set(ROARING_LIBRARY $<TARGET_FILE:roaring> PARENT_SCOPE)
set(ROARING_LIBRARIES $<TARGET_FILE:roaring> PARENT_SCOPE)

unset(_ROARING_AMAL_DIR)
1 change: 0 additions & 1 deletion thirdparty/CRoaring/CRoaring-2.0.4
Submodule CRoaring-2.0.4 deleted from 0a5c30
Loading
Loading