-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce folly to use concurrent hash map further
Signed-off-by: lizhen <[email protected]>
- Loading branch information
Showing
18 changed files
with
485 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,3 +73,5 @@ deps | |
|
||
tests/tmp | ||
bin | ||
|
||
compile_commands.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 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_guard() | ||
|
||
include(cmake/utils.cmake) | ||
|
||
FetchContent_DeclareGitHubWithMirror(pikiwidb-boost | ||
pikiwidb/boost boost-1.83.0 | ||
SHA256=A3B453E3D5FD39E6A4C733C31548512A1E74B7328D4C358FAC562930A0E6E5B4 | ||
) | ||
|
||
FetchContent_MakeAvailableWithArgs(pikiwidb-boost) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 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_guard() | ||
|
||
include(cmake/utils.cmake) | ||
|
||
FetchContent_DeclareGitHubWithMirror(double-conversion | ||
google/double-conversion v3.3.0 | ||
SHA256=4080014235f90854ffade6d1c423940b314bbca273a338235f049da296e47183 | ||
) | ||
|
||
FetchContent_MakeAvailableWithArgs(double-conversion) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
# fmt | ||
FETCHCONTENT_DECLARE( | ||
fmt | ||
GIT_REPOSITORY https://github.com/fmtlib/fmt.git | ||
GIT_TAG 10.1.0 | ||
# 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_guard() | ||
|
||
include(cmake/utils.cmake) | ||
|
||
FetchContent_DeclareGitHubWithMirror(fmt | ||
fmtlib/fmt 10.1.1 | ||
SHA256=3c2e73019178ad72b0614a3124f25de454b9ca3a1afe81d5447b8d3cbdb6d322 | ||
) | ||
FETCHCONTENT_MAKEAVAILABLE(fmt) | ||
|
||
FetchContent_MakeAvailableWithArgs(fmt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# 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. | ||
|
||
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) | ||
|
||
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() | ||
|
||
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) | ||
|
||
FetchContent_DeclareGitHubWithMirror(pikiwidb-folly | ||
pikiwidb/folly v2023.10.16.00 | ||
SHA256=EB29DC13474E3979A0680F624FF5820FA7A4E9CE0110607669AE87D69CFC104D | ||
) | ||
|
||
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}>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 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_guard() | ||
|
||
include(cmake/utils.cmake) | ||
|
||
FetchContent_DeclareGitHubWithMirror(gflags | ||
gflags/gflags v2.2.2 | ||
SHA256=19713a36c9f32b33df59d1c79b4958434cb005b5b47dc5400a7a4b078111d9b5 | ||
) | ||
|
||
FetchContent_MakeAvailableWithArgs(gflags | ||
GFLAGS_NAMESPACE=gflags | ||
BUILD_STATIC_LIBS=ON | ||
BUILD_SHARED_LIBS=OFF | ||
BUILD_gflags_LIB=ON | ||
BUILD_gflags_nothreads_LIB=OFF | ||
) | ||
|
||
find_package(Threads REQUIRED) | ||
|
||
target_link_libraries(gflags_static Threads::Threads) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 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_guard() | ||
|
||
include(cmake/utils.cmake) | ||
|
||
FetchContent_Declare(glog | ||
URL https://github.com/google/glog/archive/v0.6.0.zip | ||
URL_HASH SHA256=122fb6b712808ef43fbf80f75c52a21c9760683dae470154f02bddfc61135022 | ||
PATCH_COMMAND patch -p1 -s -E -i ${PROJECT_SOURCE_DIR}/cmake/patches/glog_demangle.patch | ||
) | ||
|
||
FetchContent_MakeAvailableWithArgs(glog | ||
CMAKE_MODULE_PATH=${PROJECT_SOURCE_DIR}/cmake/modules/glog | ||
WITH_GFLAGS=ON | ||
WITH_GTEST=OFF | ||
BUILD_SHARED_LIBS=OFF | ||
WITH_UNWIND=ON | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# 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. | ||
|
||
if(unwind_SOURCE_DIR) | ||
message(STATUS "Found unwind in ${unwind_SOURCE_DIR}") | ||
|
||
add_library(unwind::unwind ALIAS unwind) | ||
install(TARGETS unwind EXPORT glog-targets) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 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. | ||
|
||
if(gflags_SOURCE_DIR) | ||
message(STATUS "Found gflags in ${gflags_SOURCE_DIR}") | ||
|
||
install(TARGETS gflags_static EXPORT glog-targets) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 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. | ||
|
||
if(fmt_SOURCE_DIR) | ||
message(STATUS "Found fmt in ${fmt_SOURCE_DIR}") | ||
|
||
add_library(fmt::fmt ALIAS fmt) | ||
endif() |
Oops, something went wrong.