Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
27643b64
Commit
27643b64
authored
Dec 05, 2017
by
zhujiashun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add example support
parent
b92c4981
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
246 additions
and
20 deletions
+246
-20
CMakeLists.txt
CMakeLists.txt
+6
-1
CMakeLists.txt
example/CMakeLists.txt
+23
-13
CMakeLists.txt
example/asynchronous_echo_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
example/backup_request_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
example/cancel_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
example/cascade_echo_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
example/dynamic_partition_echo_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
example/echo_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
example/echo_c++_hulu_pbrpc/CMakeLists.txt
+10
-0
CMakeLists.txt
example/echo_c++_sofa_pbrpc/CMakeLists.txt
+10
-0
CMakeLists.txt
example/echo_c++_ubrpc_compack/CMakeLists.txt
+15
-0
CMakeLists.txt
example/http_c++/CMakeLists.txt
+13
-0
CMakeLists.txt
example/memcache_c++/CMakeLists.txt
+2
-0
CMakeLists.txt
example/multi_threaded_echo_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
example/multi_threaded_echo_fns_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
example/multi_threaded_mcpack_c++/CMakeLists.txt
+14
-0
CMakeLists.txt
example/nshead_extension_c++/CMakeLists.txt
+5
-0
CMakeLists.txt
example/nshead_pb_extension_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
example/parallel_echo_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
example/partition_echo_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
example/redis_c++/CMakeLists.txt
+6
-0
CMakeLists.txt
example/selective_echo_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
example/session_data_and_thread_local/CMakeLists.txt
+10
-0
CMakeLists.txt
example/streaming_echo_c++/CMakeLists.txt
+10
-0
CMakeLists.txt
src/CMakeLists.txt
+2
-6
No files found.
CMakeLists.txt
View file @
27643b64
...
...
@@ -59,6 +59,11 @@ include_directories(
${
PROTOBUF_HEADER
}
${
LEVELDB_HEADER
}
)
# for *.so
set
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
${
CMAKE_BINARY_DIR
}
/lib
)
# for *.a
set
(
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${
CMAKE_BINARY_DIR
}
/lib
)
ADD_SUBDIRECTORY
(
src
)
#
ADD_SUBDIRECTORY(example)
ADD_SUBDIRECTORY
(
example
)
example/CMakeLists.txt
View file @
27643b64
set
(
EchoClient_SOURCES
${
CMAKE_SOURCE_DIR
}
/example/echo/echo.pb.cc
${
CMAKE_SOURCE_DIR
}
/example/echo/client.cpp
)
add_executable
(
EchoClient
${
EchoClient_SOURCES
}
)
target_link_libraries
(
EchoClient brpc
)
set
(
EchoServer_SOURCES
${
CMAKE_SOURCE_DIR
}
/example/echo/echo.pb.cc
${
CMAKE_SOURCE_DIR
}
/example/echo/server.cpp
)
add_executable
(
EchoServer
${
EchoServer_SOURCES
}
)
target_link_libraries
(
EchoServer brpc
)
add_subdirectory
(
http_c++
)
add_subdirectory
(
asynchronous_echo_c++
)
add_subdirectory
(
backup_request_c++
)
add_subdirectory
(
cancel_c++
)
add_subdirectory
(
cascade_echo_c++
)
add_subdirectory
(
dynamic_partition_echo_c++
)
add_subdirectory
(
echo_c++
)
add_subdirectory
(
echo_c++_hulu_pbrpc
)
add_subdirectory
(
echo_c++_sofa_pbrpc
)
add_subdirectory
(
echo_c++_ubrpc_compack
)
add_subdirectory
(
memcache_c++
)
add_subdirectory
(
multi_threaded_echo_c++
)
add_subdirectory
(
multi_threaded_echo_fns_c++
)
add_subdirectory
(
multi_threaded_mcpack_c++
)
add_subdirectory
(
nshead_extension_c++
)
add_subdirectory
(
nshead_pb_extension_c++
)
add_subdirectory
(
parallel_echo_c++
)
add_subdirectory
(
partition_echo_c++
)
# need readline library
#add_subdirectory(redis_c++)
add_subdirectory
(
selective_echo_c++
)
add_subdirectory
(
session_data_and_thread_local
)
add_subdirectory
(
streaming_echo_c++
)
example/asynchronous_echo_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
asynchronous_echo_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
asynchronous_echo_client brpc
)
add_executable
(
asynchronous_echo_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
asynchronous_echo_server brpc
)
example/backup_request_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
backup_request_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
backup_request_client brpc
)
add_executable
(
backup_request_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
backup_request_server brpc
)
example/cancel_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
cancel_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
cancel_client brpc
)
add_executable
(
cancel_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
cancel_server brpc
)
example/cascade_echo_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
cascade_echo_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
cascade_echo_client brpc
)
add_executable
(
cascade_echo_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
cascade_echo_server brpc
)
example/dynamic_partition_echo_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
dynamic_partition_echo_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
dynamic_partition_echo_client brpc
)
add_executable
(
dynamic_partition_echo_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
dynamic_partition_echo_server brpc
)
example/echo_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
echo_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
echo_client brpc
)
add_executable
(
echo_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
echo_server brpc
)
example/echo_c++_hulu_pbrpc/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
echo_hulu_pbrpc_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
echo_hulu_pbrpc_client brpc
)
add_executable
(
echo_hulu_pbrpc_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
echo_hulu_pbrpc_server brpc
)
example/echo_c++_sofa_pbrpc/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
echo_sofa_pbrpc_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
echo_sofa_pbrpc_client brpc
)
add_executable
(
echo_sofa_pbrpc_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
echo_sofa_pbrpc_server brpc
)
example/echo_c++_ubrpc_compack/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
execute_process
(
COMMAND
${
PROTOBUF_PROTOC_EXECUTABLE
}
${
PROTO_FLAGS
}
--cpp_out=
${
CMAKE_CURRENT_BINARY_DIR
}
--proto_path=
${
PROTOBUF_INCLUDE_DIR
}
--proto_path=
${
CMAKE_CURRENT_BINARY_DIR
}
/../../src/ --proto_path=
${
CMAKE_CURRENT_BINARY_DIR
}
${
CMAKE_CURRENT_BINARY_DIR
}
/echo.proto
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_executable
(
echo_ubrpc_compack_client client.cpp echo.pb.cc
)
target_link_libraries
(
echo_ubrpc_compack_client brpc
)
add_executable
(
echo_ubrpc_compack_server server.cpp echo.pb.cc
)
target_link_libraries
(
echo_ubrpc_compack_server brpc
)
example/http_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER http.proto
)
add_executable
(
http_client http_client.cpp
)
target_link_libraries
(
http_client brpc
)
add_executable
(
http_server http_server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
http_server brpc
)
add_executable
(
benchmark_http benchmark_http.cpp
)
target_link_libraries
(
benchmark_http brpc
)
example/memcache_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
add_executable
(
memcache_client client.cpp
)
target_link_libraries
(
memcache_client brpc
)
example/multi_threaded_echo_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
multi_threaded_echo_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
multi_threaded_echo_client brpc
)
add_executable
(
multi_threaded_echo_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
multi_threaded_echo_server brpc
)
example/multi_threaded_echo_fns_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
multi_threaded_echo_fns_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
multi_threaded_echo_fns_client brpc
)
add_executable
(
multi_threaded_echo_fns_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
multi_threaded_echo_fns_server brpc
)
example/multi_threaded_mcpack_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
execute_process
(
COMMAND
${
PROTOBUF_PROTOC_EXECUTABLE
}
${
PROTO_FLAGS
}
--cpp_out=
${
CMAKE_CURRENT_BINARY_DIR
}
--proto_path=
${
PROTOBUF_INCLUDE_DIR
}
--proto_path=
${
CMAKE_CURRENT_BINARY_DIR
}
/../../src/ --proto_path=
${
CMAKE_CURRENT_BINARY_DIR
}
${
CMAKE_CURRENT_BINARY_DIR
}
/echo.proto
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_executable
(
multi_threaded_mcpack_client client.cpp echo.pb.cc
)
target_link_libraries
(
multi_threaded_mcpack_client brpc
)
add_executable
(
multi_threaded_mcpack_server server.cpp echo.pb.cc
)
target_link_libraries
(
multi_threaded_mcpack_server brpc
)
example/nshead_extension_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
add_executable
(
nshead_extension_client client.cpp
)
target_link_libraries
(
nshead_extension_client brpc
)
add_executable
(
nshead_extension_server server.cpp
)
target_link_libraries
(
nshead_extension_server brpc
)
example/nshead_pb_extension_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
nshead_pb_extension_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
nshead_pb_extension_client brpc
)
add_executable
(
nshead_pb_extension_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
nshead_pb_extension_server brpc
)
example/parallel_echo_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
parallel_echo_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
parallel_echo_client brpc
)
add_executable
(
parallel_echo_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
parallel_echo_server brpc
)
example/partition_echo_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
client brpc
)
add_executable
(
server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
server brpc
)
example/redis_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
add_executable
(
redis_cli redis_cli.cpp
)
target_link_libraries
(
redis_cli brpc
)
add_executable
(
redis_press redis_press.cpp
)
target_link_libraries
(
redis_press brpc
)
example/selective_echo_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
selective_echo_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
selective_echo_client brpc
)
add_executable
(
selective_echo_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
selective_echo_server brpc
)
example/session_data_and_thread_local/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
session_data_and_thread_local_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
session_data_and_thread_local_client brpc
)
add_executable
(
session_data_and_thread_local_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
session_data_and_thread_local_server brpc
)
example/streaming_echo_c++/CMakeLists.txt
0 → 100644
View file @
27643b64
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
add_executable
(
streaming_echo_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
streaming_echo_client brpc
)
add_executable
(
streaming_echo_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
target_link_libraries
(
streaming_echo_server brpc
)
src/CMakeLists.txt
View file @
27643b64
...
...
@@ -5,17 +5,13 @@ find_package(Protobuf REQUIRED)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
file
(
GLOB PROTOS
"*.proto"
"brpc/*.proto"
"brpc/policy/*.proto"
)
message
(
"PROTOBUF_INCLUDE_DIR=
${
PROTOBUF_INCLUDE_DIR
}
"
)
message
(
"PROTOBUF_PROTOC_EXECUTABLE=
${
PROTOBUF_PROTOC_EXECUTABLE
}
"
)
message
(
"proto=
${
PROTOS
}
"
)
message
(
"CMAKE_CURRENT_BINARY_DIR=
${
CMAKE_CURRENT_BINARY_DIR
}
"
)
list
(
APPEND PROTO_FLAGS -I
${
CMAKE_CURRENT_BINARY_DIR
}
)
foreach
(
PROTO
${
PROTOS
}
)
get_filename_component
(
PROTO_WE
${
PROTO
}
NAME_WE
)
list
(
APPEND PROTO_SRCS
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROTO_WE
}
.pb.cc"
)
list
(
APPEND PROTO_HDRS
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROTO_WE
}
.pb.h"
)
#
list(APPEND PROTO_SRCS "${CMAKE_CURRENT_BINARY_DIR}/${PROTO_WE}.pb.cc")
#
list(APPEND PROTO_HDRS "${CMAKE_CURRENT_BINARY_DIR}/${PROTO_WE}.pb.h")
execute_process
(
COMMAND
${
PROTOBUF_PROTOC_EXECUTABLE
}
${
PROTO_FLAGS
}
--cpp_out=
${
CMAKE_CURRENT_BINARY_DIR
}
--proto_path=
${
PROTOBUF_INCLUDE_DIR
}
${
PROTO
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment