-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add brpc serialization support. #11430
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
Changes from all commits
2acc420
19cb300
b5eb369
68cd387
b3a6973
9cd6f21
b436597
fa0158a
10ad682
8e079b2
ddee50f
a52adb8
3123576
166a79f
18e1743
8888078
5032b93
baf17e2
1bf3783
4544329
8cc2fbe
d7023bb
8c51dd1
f806963
2fe5b68
0355764
8780c08
f8662a1
20bef4f
cb31718
1f49a32
1c5fe25
c7dba8e
6c84d2c
18b0274
a6c7ae3
efe8abb
b1c8a6d
41f62a4
4ccd5b1
3e4fada
a77340d
66e2d44
d2cd653
12ab36d
f8f0fe0
3bb4c13
c1ebb7c
700c15b
0680a27
b2a5c94
b0fc28f
1f97756
1ee917e
aad877a
a1a3899
ee3c7dd
9965ac2
f26322a
0c2a211
aa8a03a
6e109ac
d5c5ec0
f079aea
65397b3
1fb0793
a1a59db
30d9b11
8f7904f
8aa933c
3834fa3
b27585f
c52b365
d4665bb
6fa5ac6
22140d8
e57d380
b77ee81
397b453
c690f15
56a6a15
6b638e0
0a4e750
e9adf66
839ef46
633718a
a4d489b
dc07543
36df67d
0be5ca9
949389f
03476da
0154434
830079b
9afdf93
cb087e4
a096876
8a5068a
3309437
fef1097
f5deaec
c391d49
af74a19
cc46b3c
e3ddd9a
92fb011
d260d5a
1fd988e
eecab31
3585308
046c360
4a06e90
eda4e36
2dd12aa
f6bd695
a76dc4e
a7c7bf2
bc082c7
13ca9c0
7a4adad
a5534e1
c916534
c559cd9
5a93241
65c7d83
f6b4015
db22ddc
88acffc
89394e2
b5b1f90
d492699
d6278a3
e86f86b
8c58ede
f459d4a
842747a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,14 +14,16 @@ | |
|
|
||
| INCLUDE(ExternalProject) | ||
|
|
||
| find_library(SSL_LIBRARY NAMES ssl) | ||
| 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 ${SSL_LIBRARY}) | ||
| SET_PROPERTY(TARGET ssl PROPERTY IMPORTED_LOCATION ${OPENSSL_SSL_LIBRARY}) | ||
|
|
||
| find_library(CRYPTO_LIBRARY NAMES crypto) | ||
| ADD_LIBRARY(crypto SHARED IMPORTED GLOBAL) | ||
| SET_PROPERTY(TARGET crypto PROPERTY IMPORTED_LOCATION ${CRYPTO_LIBRARY}) | ||
|
|
||
| SET_PROPERTY(TARGET crypto PROPERTY IMPORTED_LOCATION ${OPENSSL_CRYPTO_LIBRARY}) | ||
|
|
||
| SET(BRPC_SOURCES_DIR ${THIRD_PARTY_PATH}/brpc) | ||
| SET(BRPC_INSTALL_DIR ${THIRD_PARTY_PATH}/install/brpc) | ||
|
|
@@ -31,14 +33,15 @@ SET(BRPC_LIBRARIES "${BRPC_INSTALL_DIR}/lib/libbrpc.a" CACHE FILEPATH "brpc libr | |
| INCLUDE_DIRECTORIES(${BRPC_INCLUDE_DIR}) | ||
|
|
||
| # Reference https://stackoverflow.com/questions/45414507/pass-a-list-of-prefix-paths-to-externalproject-add-in-cmake-args | ||
| set(prefix_path "${THIRD_PARTY_PATH}/install/gflags|${THIRD_PARTY_PATH}/install/leveldb|${THIRD_PARTY_PATH}/install/snappy|${THIRD_PARTY_PATH}/install/gtest|${THIRD_PARTY_PATH}/install/protobuf|${THIRD_PARTY_PATH}/install/zlib") | ||
| set(prefix_path "${THIRD_PARTY_PATH}/install/gflags|${THIRD_PARTY_PATH}/install/leveldb|${THIRD_PARTY_PATH}/install/snappy|${THIRD_PARTY_PATH}/install/gtest|${THIRD_PARTY_PATH}/install/protobuf|${THIRD_PARTY_PATH}/install/zlib|${THIRD_PARTY_PATH}/install/glog") | ||
|
|
||
| # If minimal .a is need, you can set WITH_DEBUG_SYMBOLS=OFF | ||
| ExternalProject_Add( | ||
| extern_brpc | ||
| ${EXTERNAL_PROJECT_LOG_ARGS} | ||
| # TODO(gongwb): change to de newst repo when they changed. | ||
| GIT_REPOSITORY "https://github.com/gongweibao/brpc" | ||
| GIT_TAG "7dc04defad1fd4173aae170c3fcbde131b65155a" | ||
| GIT_TAG "e9b67ec1b7458f2af5fae76451afe1e27e01b4b4" | ||
| PREFIX ${BRPC_SOURCES_DIR} | ||
| UPDATE_COMMAND "" | ||
| CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
|
|
@@ -50,7 +53,7 @@ ExternalProject_Add( | |
| -DCMAKE_POSITION_INDEPENDENT_CODE=ON | ||
| -DCMAKE_BUILD_TYPE=${THIRD_PARTY_BUILD_TYPE} | ||
| -DCMAKE_PREFIX_PATH=${prefix_path} | ||
| -DBRPC_WITH_GLOG=ON | ||
| -DWITH_GLOG=ON | ||
| -DIOBUF_WITH_HUGE_BLOCK=ON | ||
| -DBRPC_WITH_RDMA=${WITH_BRPC_RDMA} | ||
| ${EXTERNAL_OPTIONAL_ARGS} | ||
|
|
@@ -65,5 +68,6 @@ ADD_LIBRARY(brpc STATIC IMPORTED GLOBAL) | |
| SET_PROPERTY(TARGET brpc PROPERTY IMPORTED_LOCATION ${BRPC_LIBRARIES}) | ||
| ADD_DEPENDENCIES(brpc extern_brpc) | ||
|
|
||
| add_definitions(-DBRPC_WITH_GLOG) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this used for?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Brpc use this macro to distinguish glog with brpc's own log. |
||
|
|
||
| LIST(APPEND external_project_dependencies brpc) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,8 +12,12 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| IF(WITH_TESTING) | ||
| ENABLE_TESTING() | ||
| #FIXME:(gongwb) Move brpc's gtest dependency. | ||
| IF(WITH_TESTING OR (WITH_DISTRIBUTE AND NOT WITH_GRPC)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems not safe. fix it now?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gtest is needed by brpc now. |
||
| IF(WITH_TESTING) | ||
| ENABLE_TESTING() | ||
| ENDIF(WITH_TESTING) | ||
|
|
||
| INCLUDE(ExternalProject) | ||
|
|
||
| SET(GTEST_SOURCES_DIR ${THIRD_PARTY_PATH}/gtest) | ||
|
|
@@ -76,4 +80,4 @@ IF(WITH_TESTING) | |
| ADD_DEPENDENCIES(gtest_main extern_gtest) | ||
|
|
||
| LIST(APPEND external_project_dependencies gtest gtest_main) | ||
| ENDIF(WITH_TESTING) | ||
| ENDIF(WITH_TESTING OR (WITH_DISTRIBUTE AND NOT WITH_GRPC)) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use the default for benchmark?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Large block size can get better performance.