Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:import braft #130

Merged
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6e45317
feat:Import braft (#133)
panlei-coder Jan 18, 2024
cfe3482
fix:fixed a bug where the compiler could not find glog (#134)
panlei-coder Jan 19, 2024
aea6aca
fix:fixed a bug that included braft (#163)
panlei-coder Feb 3, 2024
ea22b29
change rm command format
AlexStocks Feb 7, 2024
2090c8c
fix:Synchronize the latest changes to the import-braft branch (#180)
panlei-coder Feb 27, 2024
2a49a98
feat: import braft
panlei-coder Jan 9, 2024
0f1eada
fix: fix braft.cmake
panlei-coder Jan 9, 2024
036bb94
fix:fix import braft cmake
panlei-coder Jan 12, 2024
8ec20df
fix: fix fetchcontent_populate
panlei-coder Jan 12, 2024
9cc9f53
fix: fix find gflags brpc braft cmake
panlei-coder Jan 14, 2024
37b7744
add independent code and fix brpc
Centurybbx Jan 15, 2024
9c366a5
fix: delete unnecessary comments
panlei-coder Jan 16, 2024
7dfb91d
fix: fix fetch content to ExternalProject_Add
panlei-coder Jan 18, 2024
921fe14
fix: add counter.pb.h and counter.pb.cc
panlei-coder Jan 18, 2024
1ca6b3b
fix: fixed a bug where the compiler could not find glog
panlei-coder Jan 19, 2024
7262dd0
fix:fixed a bug that included braft
panlei-coder Jan 31, 2024
bf54c66
fix:fix bug in debug mode
panlei-coder Feb 25, 2024
3a5d540
fix:fixed a bug where the compiler could not find glog (#134)
panlei-coder Jan 19, 2024
cabc2c0
fix:resolve code conflicts
panlei-coder Feb 26, 2024
311458a
fix:disable glog
panlei-coder Feb 27, 2024
bfd087f
fix:fix compilation issues on mac
panlei-coder Feb 28, 2024
3b50bf6
Merge branch 'import-braft' into import-braft
panlei-coder Feb 28, 2024
cef1beb
mac & linux
dingxiaoshuai123 Feb 29, 2024
2e048e4
fix:resolve fail of not found leveldb
panlei-coder Feb 29, 2024
a5cfb78
fix:uniformly capitalize the cmake keyword
panlei-coder Feb 29, 2024
7c78fce
fix:fix comment
panlei-coder Mar 3, 2024
e2c8b98
fix:Change the number of threads at compile time for braft and brpc
panlei-coder Mar 4, 2024
905ea44
fix:delete test/counter files
panlei-coder Mar 6, 2024
9e5ab28
fix:Change the branch of the third-party library braft to master
panlei-coder Mar 6, 2024
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
56 changes: 46 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) 2023-present, Qihoo, Inc. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.

CMAKE_MINIMUM_REQUIRED(VERSION 3.14)
PROJECT(PikiwiDB)

Expand Down Expand Up @@ -25,7 +30,7 @@ ELSEIF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
ENDIF ()


############# You should enable sanitizer if you are developing pika #############
############# You should enable sanitizer if you are developing pikiwidb #############
# Uncomment the following two lines to enable AddressSanitizer to detect memory leaks and other memory-related bugs.
# SET(CMAKE_BUILD_TYPE "Debug")
# SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address -O0 -fno-omit-frame-pointer -fno-optimize-sibling-calls")
Expand Down Expand Up @@ -91,28 +96,59 @@ SET(INSTALL_LIBDIR ${STAGED_INSTALL_PREFIX}/lib)
SET(INSTALL_LIBDIR_64 ${STAGED_INSTALL_PREFIX}/lib64)
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${STAGED_INSTALL_PREFIX})
SET(BUILD_SUPPORT_DIR ${PROJECT_SOURCE_DIR}/build_support)
# make sure we use the same compiler for all dependencies
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)

MESSAGE(STATUS "${PROJECT_NAME} staged install: ${STAGED_INSTALL_PREFIX}")
MESSAGE(STATUS "Current platform: ${OS_VERSION} ")
CMAKE_HOST_SYSTEM_INFORMATION(RESULT CPU_CORE QUERY NUMBER_OF_LOGICAL_CORES)
MESSAGE(STATUS "CPU core ${CPU_CORE}")

#openssl
FIND_PACKAGE(OpenSSL REQUIRED)

MESSAGE(STATUS "ssl:" ${OPENSSL_SSL_LIBRARY})
MESSAGE(STATUS "crypto:" ${OPENSSL_CRYPTO_LIBRARY})

ADD_LIBRARY(ssl SHARED IMPORTED GLOBAL)
SET_PROPERTY(TARGET ssl PROPERTY IMPORTED_LOCATION ${OPENSSL_SSL_LIBRARY})

ADD_LIBRARY(crypto SHARED IMPORTED GLOBAL)
SET_PROPERTY(TARGET crypto PROPERTY IMPORTED_LOCATION ${OPENSSL_CRYPTO_LIBRARY})

SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

SET(THIRD_PARTY_PATH ${CMAKE_CURRENT_BINARY_DIR}/third-party)
SET(THIRD_PARTY_BUILD_TYPE Release)
SET(EXTERNAL_PROJECT_LOG_ARGS
LOG_DOWNLOAD 0
LOG_UPDATE 1
LOG_CONFIGURE 0
LOG_BUILD 0
LOG_TEST 1
LOG_INSTALL 0)

INCLUDE(FetchContent)
#include(cmake/CmakeLists.txt)

include(cmake/findTools.cmake)
include(cmake/libevent.cmake)
include(cmake/llhttp.cmake)
include(cmake/fmt.cmake)
include(cmake/spdlog.cmake)
include(cmake/gtest.cmake)
include(cmake/rocksdb.cmake)
INCLUDE(gflags)
INCLUDE(findTools)
INCLUDE(leveldb)
INCLUDE(libevent)
INCLUDE(llhttp)
INCLUDE(fmt)
INCLUDE(spdlog)
INCLUDE(gtest)
INCLUDE(rocksdb)
INCLUDE(zlib)
INCLUDE(protobuf)
INCLUDE(brpc)
INCLUDE(braft)

enable_testing()
ENABLE_TESTING()

ADD_SUBDIRECTORY(src/pstd)
ADD_SUBDIRECTORY(src/net)
ADD_SUBDIRECTORY(src/counter)
ADD_SUBDIRECTORY(src/storage)
ADD_SUBDIRECTORY(src)

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BUILD_TIME=${BUILD_TIME: 0: 10}
COMMIT_ID=$(git rev-parse HEAD)
SHORT_COMMIT_ID=${COMMIT_ID: 0: 8}

BUILD_TYPE=release
BUILD_TYPE=Release
VERBOSE=0
CMAKE_FLAGS=""
MAKE_FLAGS=""
Expand Down
4 changes: 2 additions & 2 deletions cmake/boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.

include_guard()
INCLUDE_GUARD()

include(cmake/utils.cmake)
INCLUDE(cmake/utils.cmake)

FetchContent_DeclareGitHubWithMirror(pikiwidb-boost
pikiwidb/boost boost-1.83.0
Expand Down
48 changes: 48 additions & 0 deletions cmake/braft.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) 2023-present, Qihoo, Inc. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.

INCLUDE(ExternalProject)

SET(BRAFT_SOURCES_DIR ${THIRD_PARTY_PATH}/braft)
SET(BRAFT_INSTALL_DIR ${THIRD_PARTY_PATH}/install/braft)
SET(BRAFT_INCLUDE_DIR "${BRAFT_INSTALL_DIR}/include" CACHE PATH "braft include directory." FORCE)
SET(BRAFT_LIBRARIES "${BRAFT_INSTALL_DIR}/lib/libbraft.a" CACHE FILEPATH "braft library." FORCE)

SET(NUM_OF_PROCESSOR 1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pikiwidb里的cmake有一个代码是获取cpu核数的,可以复用那个代码。只用一个cpu编译会比较慢。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的


SET(prefix_path "${THIRD_PARTY_PATH}/install/brpc|${CMAKE_CURRENT_BINARY_DIR}/_deps/gflags-build|${THIRD_PARTY_PATH}/install/protobuf|${THIRD_PARTY_PATH}/install/zlib|${CMAKE_CURRENT_BINARY_DIR}/_deps/leveldb-build|${CMAKE_CURRENT_BINARY_DIR}/_deps/leveldb-src")

ExternalProject_Add(
AlexStocks marked this conversation as resolved.
Show resolved Hide resolved
extern_braft
${EXTERNAL_PROJECT_LOG_ARGS}
DEPENDS brpc
URL "https://github.com/baidu/braft/archive/v1.1.2.tar.gz"
PREFIX ${BRAFT_SOURCES_DIR}
UPDATE_COMMAND ""
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_PREFIX=${BRAFT_INSTALL_DIR}
-DCMAKE_INSTALL_LIBDIR=${BRAFT_INSTALL_DIR}/lib
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_BUILD_TYPE=${THIRD_PARTY_BUILD_TYPE}
-DCMAKE_PREFIX_PATH=${prefix_path}
-DBRPC_WITH_GLOG=OFF
-DWITH_DEBUG_SYMBOLS=OFF
${EXTERNAL_OPTIONAL_ARGS}
LIST_SEPARATOR |
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${BRAFT_INSTALL_DIR}
-DCMAKE_INSTALL_LIBDIR:PATH=${BRAFT_INSTALL_DIR}/lib
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
-DCMAKE_BUILD_TYPE:STRING=${THIRD_PARTY_BUILD_TYPE}
BUILD_IN_SOURCE 1
BUILD_COMMAND $(MAKE) -j ${NUM_OF_PROCESSOR} braft-static
INSTALL_COMMAND mkdir -p ${BRAFT_INSTALL_DIR}/lib/ COMMAND cp ${BRAFT_SOURCES_DIR}/src/extern_braft/output/lib/libbraft.a ${BRAFT_LIBRARIES} COMMAND cp -r ${BRAFT_SOURCES_DIR}/src/extern_braft/output/include ${BRAFT_INCLUDE_DIR}/
)
ADD_DEPENDENCIES(extern_braft brpc)
ADD_LIBRARY(braft STATIC IMPORTED GLOBAL)
SET_PROPERTY(TARGET braft PROPERTY IMPORTED_LOCATION ${BRAFT_LIBRARIES})
ADD_DEPENDENCIES(braft extern_braft)
50 changes: 50 additions & 0 deletions cmake/brpc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright (c) 2023-present, Qihoo, Inc. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.

INCLUDE(ExternalProject)

SET(BRPC_SOURCES_DIR ${THIRD_PARTY_PATH}/brpc)
SET(BRPC_INSTALL_DIR ${THIRD_PARTY_PATH}/install/brpc)
SET(BRPC_INCLUDE_DIR "${BRPC_INSTALL_DIR}/include" CACHE PATH "brpc include directory." FORCE)
SET(BRPC_LIBRARIES "${BRPC_INSTALL_DIR}/lib/libbrpc.a" CACHE FILEPATH "brpc library." FORCE)

SET(NUM_OF_PROCESSOR 1)

# Reference https://stackoverflow.com/questions/45414507/pass-a-list-of-prefix-paths-to-externalproject-add-in-cmake-args
SET(prefix_path "${CMAKE_CURRENT_BINARY_DIR}/_deps/gflags-build|${THIRD_PARTY_PATH}/install/protobuf|${THIRD_PARTY_PATH}/install/zlib|${CMAKE_CURRENT_BINARY_DIR}/_deps/leveldb-build|${CMAKE_CURRENT_BINARY_DIR}/_deps/leveldb-src")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
# If minimal .a is need, you can set WITH_DEBUG_SYMBOLS=OFF
EXTERNALPROJECT_ADD(
extern_brpc
${EXTERNAL_PROJECT_LOG_ARGS}
DEPENDS ssl crypto zlib protobuf leveldb gflags
URL "https://github.com/apache/brpc/archive/1.3.0.tar.gz"
PREFIX ${BRPC_SOURCES_DIR}
UPDATE_COMMAND ""
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_PREFIX=${BRPC_INSTALL_DIR}
-DCMAKE_INSTALL_LIBDIR=${BRPC_INSTALL_DIR}/lib
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_BUILD_TYPE=${THIRD_PARTY_BUILD_TYPE}
-DCMAKE_PREFIX_PATH=${prefix_path}
-DWITH_GLOG=OFF
-DDOWNLOAD_GTEST=OFF
${EXTERNAL_OPTIONAL_ARGS}
LIST_SEPARATOR |
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${BRPC_INSTALL_DIR}
-DCMAKE_INSTALL_LIBDIR:PATH=${BRPC_INSTALL_DIR}/lib
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
-DCMAKE_BUILD_TYPE:STRING=${THIRD_PARTY_BUILD_TYPE}
BUILD_IN_SOURCE 1
BUILD_COMMAND $(MAKE) -j ${NUM_OF_PROCESSOR} brpc-static
INSTALL_COMMAND mkdir -p ${BRPC_INSTALL_DIR}/lib/ COMMAND cp ${BRPC_SOURCES_DIR}/src/extern_brpc/output/lib/libbrpc.a ${BRPC_LIBRARIES} COMMAND cp -r ${BRPC_SOURCES_DIR}/src/extern_brpc/output/include ${BRPC_INCLUDE_DIR}/
)
ADD_DEPENDENCIES(extern_brpc ssl crypto zlib protobuf leveldb gflags)
ADD_LIBRARY(brpc STATIC IMPORTED GLOBAL)
SET_PROPERTY(TARGET brpc PROPERTY IMPORTED_LOCATION ${BRPC_LIBRARIES})
ADD_DEPENDENCIES(brpc extern_brpc)
5 changes: 3 additions & 2 deletions cmake/double-conversion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.

include_guard()
INCLUDE_GUARD()

include(cmake/utils.cmake)
INCLUDE(cmake/utils.cmake)

FetchContent_DeclareGitHubWithMirror(double-conversion
google/double-conversion v3.3.0
SHA256=4080014235f90854ffade6d1c423940b314bbca273a338235f049da296e47183
)

FetchContent_MakeAvailableWithArgs(double-conversion
BUILD_TESTING=OFF
)
43 changes: 24 additions & 19 deletions cmake/findTools.cmake
Original file line number Diff line number Diff line change
@@ -1,59 +1,64 @@
# Copyright (c) 2023-present, Qihoo, Inc. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.

FIND_PROGRAM(AUTOCONF autoconf PATHS /usr/bin /usr/local/bin)

IF(${AUTOCONF} MATCHES AUTOCONF-NOTFOUND)
IF (${AUTOCONF} MATCHES AUTOCONF-NOTFOUND)
MESSAGE(FATAL_ERROR "not find autoconf on localhost")
ENDIF()
ENDIF ()

#set(CLANG_SEARCH_PATH "/usr/local/bin" "/usr/bin" "/usr/local/opt/llvm/bin"
# "/usr/local/opt/llvm@12/bin")
FIND_PROGRAM(CLANG_FORMAT_BIN
NAMES clang-format
HINTS ${CLANG_SEARCH_PATH})
IF("${CLANG_FORMAT_BIN}" STREQUAL "CLANG_FORMAT_BIN-NOTFOUND")
IF ("${CLANG_FORMAT_BIN}" STREQUAL "CLANG_FORMAT_BIN-NOTFOUND")
MESSAGE(WARNING "couldn't find clang-format.")
ELSE()
ELSE ()
MESSAGE(STATUS "found clang-format at ${CLANG_FORMAT_BIN}")
ENDIF()
ENDIF ()

FIND_PROGRAM(CLANG_TIDY_BIN
NAMES clang-tidy clang-tidy-12
HINTS ${CLANG_SEARCH_PATH})
IF("${CLANG_TIDY_BIN}" STREQUAL "CLANG_TIDY_BIN-NOTFOUND")
IF ("${CLANG_TIDY_BIN}" STREQUAL "CLANG_TIDY_BIN-NOTFOUND")
MESSAGE(WARNING "couldn't find clang-tidy.")
ELSE()
ELSE ()
MESSAGE(STATUS "found clang-tidy at ${CLANG_TIDY_BIN}")
ENDIF()
ENDIF ()

FIND_PROGRAM(CPPLINT_BIN
NAMES cpplint cpplint.py
HINTS "${BUILD_SUPPORT_DIR}")
IF("${CPPLINT_BIN}" STREQUAL "CPPLINT_BIN-NOTFOUND")
IF ("${CPPLINT_BIN}" STREQUAL "CPPLINT_BIN-NOTFOUND")
MESSAGE(WARNING "couldn't find cpplint.py")
ELSE()
ELSE ()
MESSAGE(STATUS "found cpplint at ${CPPLINT_BIN}")
ENDIF()
ENDIF ()

FIND_PROGRAM(CLANG_APPLY_REPLACEMENTS_BIN
NAMES clang-apply-replacements clang-apply-replacements-12
HINTS ${CLANG_SEARCH_PATH})

IF("${CLANG_APPLY_REPLACEMENTS_BIN}" STREQUAL "CLANG_APPLY_REPLACEMENTS_BIN-NOTFOUND")
IF ("${CLANG_APPLY_REPLACEMENTS_BIN}" STREQUAL "CLANG_APPLY_REPLACEMENTS_BIN-NOTFOUND")
MESSAGE(WARNING "couldn't find clang-apply-replacements.")
ELSE()
ELSE ()
MESSAGE(STATUS "found clang-apply-replacements at ${CLANG_APPLY_REPLACEMENTS_BIN}")
ENDIF()
ENDIF ()

OPTION(WITH_COMMAND_DOCS "build with command docs support" OFF)
IF(WITH_COMMAND_DOCS)
IF (WITH_COMMAND_DOCS)
ADD_DEFINITIONS(-DWITH_COMMAND_DOCS)
ENDIF()
ENDIF ()

IF(${CMAKE_BUILD_TYPE} MATCHES "RELEASE")
IF (${CMAKE_BUILD_TYPE} MATCHES "RELEASE")
MESSAGE(STATUS "make RELEASE version")
ADD_DEFINITIONS(-DBUILD_RELEASE)
SET(BuildType "Release")
ELSE()
ELSE ()
MESSAGE(STATUS "make DEBUG version")
ADD_DEFINITIONS(-DBUILD_DEBUG)
SET(BuildType "Debug")
ENDIF()
ENDIF ()
4 changes: 2 additions & 2 deletions cmake/fmt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.

include_guard()
INCLUDE_GUARD()

include(cmake/utils.cmake)
INCLUDE(cmake/utils.cmake)

FetchContent_DeclareGitHubWithMirror(fmt
fmtlib/fmt 10.1.1
Expand Down
42 changes: 21 additions & 21 deletions cmake/folly.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.

set(DEPS_FETCH_PROXY "" CACHE STRING
SET(DEPS_FETCH_PROXY "" CACHE STRING
"a template URL to proxy the traffic for fetching dependencies, e.g. with DEPS_FETCH_PROXY = https://some-proxy/,
https://example/some-dep.zip -> https://some-proxy/https://example/some-dep.zip")

cmake_host_system_information(RESULT CPU_CORE QUERY NUMBER_OF_LOGICAL_CORES)
CMAKE_HOST_SYSTEM_INFORMATION(RESULT CPU_CORE QUERY NUMBER_OF_LOGICAL_CORES)

if(CMAKE_GENERATOR STREQUAL "Ninja")
set(MAKE_COMMAND make -j${CPU_CORE})
else()
set(MAKE_COMMAND $(MAKE) -j${CPU_CORE})
endif()
IF (CMAKE_GENERATOR STREQUAL "Ninja")
SET(MAKE_COMMAND make -j${CPU_CORE})
ELSE ()
SET(MAKE_COMMAND $(MAKE) -j${CPU_CORE})
ENDIF ()

if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()
IF (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
CMAKE_POLICY(SET CMP0135 NEW)
ENDIF ()

include(cmake/utils.cmake)
include(cmake/boost.cmake)
include(cmake/unwind.cmake)
include(cmake/gflags.cmake)
include(cmake/glog.cmake)
include(cmake/double-conversion.cmake)
include(cmake/fmt.cmake)
INCLUDE(cmake/utils.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/unwind.cmake)
INCLUDE(cmake/gflags.cmake)
INCLUDE(cmake/glog.cmake)
INCLUDE(cmake/double-conversion.cmake)
INCLUDE(cmake/fmt.cmake)

add_compile_definitions(FOLLY_NO_CONFIG)
ADD_COMPILE_DEFINITIONS(FOLLY_NO_CONFIG)

FetchContent_Declare(pikiwidb-folly
FETCHCONTENT_DECLARE(pikiwidb-folly
URL https://github.com/pikiwidb/folly/archive/v2023.10.16.00.zip
URL_HASH SHA256=EB29DC13474E3979A0680F624FF5820FA7A4E9CE0110607669AE87D69CFC104D
PATCH_COMMAND patch -p1 -s -E -i ${PROJECT_SOURCE_DIR}/cmake/patches/folly_coroutine.patch
)

FetchContent_MakeAvailableWithArgs(pikiwidb-folly)

target_link_libraries(pikiwidb-folly pikiwidb-boost glog double-conversion fmt)
target_include_directories(pikiwidb-folly PUBLIC $<BUILD_INTERFACE:${pikiwidb-folly_SOURCE_DIR}>)
TARGET_LINK_LIBRARIES(pikiwidb-folly pikiwidb-boost glog double-conversion fmt)
TARGET_INCLUDE_DIRECTORIES(pikiwidb-folly PUBLIC $<BUILD_INTERFACE:${pikiwidb-folly_SOURCE_DIR}>)
Loading
Loading