Skip to content

Commit

Permalink
Introduce dependency xxhash for bloomfilter (#1694)
Browse files Browse the repository at this point in the history
  • Loading branch information
PragmaTwice authored Aug 24, 2023
1 parent a426939 commit 5ab57c3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ include(cmake/rocksdb.cmake)
include(cmake/libevent.cmake)
include(cmake/fmt.cmake)
include(cmake/jsoncons.cmake)
include(cmake/xxhash.cmake)

if (ENABLE_LUAJIT)
include(cmake/luajit.cmake)
Expand Down Expand Up @@ -160,6 +161,7 @@ list(APPEND EXTERNAL_LIBS tbb)
list(APPEND EXTERNAL_LIBS jsoncons)
list(APPEND EXTERNAL_LIBS Threads::Threads)
list(APPEND EXTERNAL_LIBS ${Backtrace_LIBRARY})
list(APPEND EXTERNAL_LIBS xxhash)

# Add git sha to version.h
find_package(Git REQUIRED)
Expand Down
1 change: 1 addition & 0 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ endmacro()

function(FetchContent_MakeAvailableWithArgs dep)
if(NOT ${dep}_POPULATED)
message("Fetching ${dep}...")
FetchContent_Populate(${dep})

foreach(arg IN LISTS ARGN)
Expand Down
35 changes: 35 additions & 0 deletions cmake/xxhash.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

include_guard()

include(cmake/utils.cmake)

FetchContent_DeclareGitHubWithMirror(xxhash
Cyan4973/xxHash v0.8.2
MD5=4b793d916f9b8e4ceb984a00e356bdb2
)

FetchContent_GetProperties(xxhash)
if(NOT xxhash_POPULATED)
FetchContent_Populate(xxhash)

set(BUILD_SHARED_LIBS OFF)
set(XXHASH_BUILD_XXHSUM OFF)

add_subdirectory(${xxhash_SOURCE_DIR}/cmake_unofficial ${xxhash_BUILD_DIR} EXCLUDE_FROM_ALL)
endif()

0 comments on commit 5ab57c3

Please sign in to comment.