diff --git a/CMakeLists.txt b/CMakeLists.txt index 8435c0aeb60..9b25fab1639 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") @@ -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) diff --git a/cmake/rocksdb.cmake b/cmake/rocksdb.cmake index 631e336c05b..688212f8f08 100644 --- a/cmake/rocksdb.cmake +++ b/cmake/rocksdb.cmake @@ -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 diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 40773e01349..51f1690afe6 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -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()