Skip to content

Commit

Permalink
modify rocksdb path for kvrocks 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Chang Guo (Student) authored and Change72 committed Oct 26, 2023
1 parent 17b31e7 commit 408bc4a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "C

if(ENABLE_STATIC_LIBSTDCXX)
try_compile(FOUND_STATIC_LIBSTDCXX ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/cmake/checks/static_libstdcxx.cc
LINK_OPTIONS -static-libstdc++ CXX_STANDARD 11)
LINK_OPTIONS -static-libstdc++ CXX_STANDARD 17)

if(NOT FOUND_STATIC_LIBSTDCXX)
message(FATAL_ERROR "cannot find static library of libstdc++, please add ENABLE_STATIC_LIBSTDCXX=OFF to disable")
Expand All @@ -172,6 +172,10 @@ list(FILTER KVROCKS_SRCS EXCLUDE REGEX src/main.cc)

add_library(kvrocks_objs OBJECT ${KVROCKS_SRCS})

link_directories($ENV{HADOOP_HOME}/lib/native)
link_directories($ENV{JAVA_HOME}/jre/lib/amd64/server)
link_directories($ENV{JAVA_HOME}/jre/lib/amd64)

target_include_directories(kvrocks_objs PUBLIC src src/common ${PROJECT_BINARY_DIR})
target_compile_features(kvrocks_objs PUBLIC cxx_std_17)
target_compile_options(kvrocks_objs PUBLIC -Wall -Wpedantic -Wsign-compare -Wreturn-type -fno-omit-frame-pointer)
Expand Down
8 changes: 4 additions & 4 deletions cmake/rocksdb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ endif()

include(cmake/utils.cmake)

FetchContent_DeclareGitHubWithMirror(rocksdb
facebook/rocksdb v6.29.5
MD5=b7efb227f10a668adcb914c973f19648
FetchContent_DeclareGitHubWithMirrorR(rocksdb
asu-idi/rocksdb_get_block_private.git
origin/cache_filter
)

FetchContent_GetProperties(jemalloc)
FetchContent_GetProperties(snappy)

FetchContent_MakeAvailableWithArgs(rocksdb
CMAKE_MODULE_PATH=${PROJECT_SOURCE_DIR}/cmake/modules # to locate FindJeMalloc.cmake
# CMAKE_MODULE_PATH=${PROJECT_SOURCE_DIR}/cmake/modules # to locate FindJeMalloc.cmake
Snappy_DIR=${PROJECT_SOURCE_DIR}/cmake/modules # to locate SnappyConfig.cmake
FAIL_ON_WARNINGS=OFF
WITH_TESTS=OFF
Expand Down
14 changes: 14 additions & 0 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,17 @@ function(FetchContent_DeclareGitHubWithMirror dep repo tag hash)
${hash}
)
endfunction()

function(FetchContent_DeclareWithMirrorR dep url tag)
FetchContent_Declare(${dep}
GIT_REPOSITORY ${DEPS_FETCH_PROXY}${url}
GIT_TAG ${tag}
)
endfunction()

function(FetchContent_DeclareGitHubWithMirrorR dep repo tag)
FetchContent_DeclareWithMirrorR(${dep}
https://github.com/${repo}
${tag}
)
endfunction()

0 comments on commit 408bc4a

Please sign in to comment.