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
997522bc
Commit
997522bc
authored
Dec 26, 2017
by
zhujiashun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unnecessary find protobuf
parent
c90162a1
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
23 additions
and
87 deletions
+23
-87
.travis.yml
.travis.yml
+1
-9
CMakeLists.txt
CMakeLists.txt
+15
-16
CMakeLists.txt
example/CMakeLists.txt
+4
-0
CMakeLists.txt
example/asynchronous_echo_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/backup_request_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/cancel_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/cascade_echo_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/dynamic_partition_echo_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/echo_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/echo_c++_hulu_pbrpc/CMakeLists.txt
+0
-3
CMakeLists.txt
example/echo_c++_sofa_pbrpc/CMakeLists.txt
+0
-3
CMakeLists.txt
example/echo_c++_ubrpc_compack/CMakeLists.txt
+0
-3
CMakeLists.txt
example/http_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/multi_threaded_echo_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/multi_threaded_echo_fns_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/multi_threaded_mcpack_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/nshead_pb_extension_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/parallel_echo_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/partition_echo_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/selective_echo_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
example/session_data_and_thread_local/CMakeLists.txt
+0
-3
CMakeLists.txt
example/streaming_echo_c++/CMakeLists.txt
+0
-3
CMakeLists.txt
src/CMakeLists.txt
+1
-4
CMakeLists.txt
test/CMakeLists.txt
+2
-1
No files found.
.travis.yml
View file @
997522bc
...
...
@@ -11,16 +11,8 @@ env:
-
PURPOSE=unittest
install
:
-
sudo apt-get install -qq realpath libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev libgoogle-perftools-dev
libpthread-stubs0-dev libboost-all-dev
-
sudo apt-get install -qq realpath libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev libgoogle-perftools-dev
-
sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo env "PATH=$PATH" cmake . && sudo make && sudo mv libgtest* /usr/lib/ && cd -
script
:
-
sh build_in_travis_ci.sh
addons
:
apt
:
sources
:
-
george-edison55-precise-backports
packages
:
-
cmake-data
-
cmake
CMakeLists.txt
View file @
997522bc
cmake_minimum_required
(
VERSION
3.1
)
cmake_minimum_required
(
VERSION
2.8.10
)
project
(
brpc C CXX
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8
)
#message(FATAL_ERROR "GCC is too old, please install a newer version supporting C++11")
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
# require at least gcc 4.8
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8
)
message
(
FATAL_ERROR
"GCC is too old, please install a newer version supporting C++11"
)
endif
()
elseif
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
)
# require at least clang 3.3
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3
)
message
(
FATAL_ERROR
"Clang is too old, please install a newer version supporting C++11"
)
endif
()
else
()
message
(
WARNING
"You are using an unsupported compiler! Compilation has only been tested with Clang and GCC."
)
endif
()
option
(
WITH_GLOG
"With glog"
OFF
)
option
(
BRPC_DEBUG
"With debug symbol"
ON
)
option
(
BUILD_EXAMPLE
"Whether building examples"
O
FF
)
option
(
BUILD_EXAMPLE
"Whether building examples"
O
N
)
option
(
BUILD_UNIT_TESTS
"Whether building unit tests"
OFF
)
if
(
WITH_GLOG
)
...
...
@@ -30,8 +40,7 @@ execute_process(
COMMAND bash -c
"grep
\"
namespace [_A-Za-z0-9]
\\
+ {
\"
${
GFLAGS_INCLUDE_PATH
}
/gflags/gflags_declare.h | head -1 | awk '{print $2}' | tr -d '
\n
'"
OUTPUT_VARIABLE GFLAGS_NS
)
# STREQUAL not works. Use MATCHES as workaround
if
(
${
GFLAGS_NS
}
MATCHES
".*GFLAGS_NAMESPACE.*"
)
if
(
${
GFLAGS_NS
}
STREQUAL
"GFLAGS_NAMESPACE"
)
execute_process
(
COMMAND bash -c
"grep
\"
#define GFLAGS_NAMESPACE [_A-Za-z0-9]
\\
+
\"
${
GFLAGS_INCLUDE_PATH
}
/gflags/gflags_declare.h | head -1 | awk '{print $3}' | tr -d '
\n
'"
OUTPUT_VARIABLE GFLAGS_NS
...
...
@@ -63,15 +72,6 @@ if(NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-aligned-new"
)
endif
()
#find_package(Threads REQUIRED)
#find_path(GFLAGS_HEADER NAMES gflags/gflags.h)
#find_library(GFLAGS_LIB NAMES gflags)
#find_package(gflags REQUIRED)
#find_path(THREADS_HEADER NAMES pthread.h)
#find_library(THREADS_LIB NAMES pthread)
find_path
(
PROTOBUF_HEADER NAMES google/protobuf/stubs/common.h
)
find_library
(
PROTOBUF_LIB NAMES protobuf
)
...
...
@@ -91,7 +91,6 @@ include_directories(
${
PROTOBUF_HEADER
}
${
LEVELDB_HEADER
}
${
THREAD_HEADER
}
#${THREADS_HEADER}
)
# for *.so
...
...
example/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
add_subdirectory
(
http_c++
)
add_subdirectory
(
asynchronous_echo_c++
)
add_subdirectory
(
backup_request_c++
)
...
...
example/asynchronous_echo_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/backup_request_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/cancel_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/cascade_echo_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/dynamic_partition_echo_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/echo_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/echo_c++_hulu_pbrpc/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/echo_c++_sofa_pbrpc/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/echo_c++_ubrpc_compack/CMakeLists.txt
View file @
997522bc
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_SOURCE_DIR
}
/src --proto_path=
${
CMAKE_SOURCE_DIR
}
/example/echo_c++_ubrpc_compack/
${
CMAKE_SOURCE_DIR
}
/example/echo_c++_ubrpc_compack/echo.proto
...
...
example/http_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER http.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/multi_threaded_echo_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/multi_threaded_echo_fns_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/multi_threaded_mcpack_c++/CMakeLists.txt
View file @
997522bc
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_SOURCE_DIR
}
/src --proto_path=
${
CMAKE_SOURCE_DIR
}
/example/multi_threaded_mcpack_c++
${
CMAKE_SOURCE_DIR
}
/example/multi_threaded_mcpack_c++/echo.proto
...
...
example/nshead_pb_extension_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/parallel_echo_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/partition_echo_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/selective_echo_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/session_data_and_thread_local/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
example/streaming_echo_c++/CMakeLists.txt
View file @
997522bc
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
protobuf_generate_cpp
(
PROTO_SRC PROTO_HEADER echo.proto
)
get_filename_component
(
HEADER_DIR
${
PROTO_HEADER
}
DIRECTORY
)
include_directories
(
${
HEADER_DIR
}
)
...
...
src/CMakeLists.txt
View file @
997522bc
...
...
@@ -191,18 +191,15 @@ add_library(brpc SHARED ${SOURCES})
add_library
(
brpc_static STATIC
${
SOURCES
}
)
target_link_libraries
(
brpc
#${CMAKE_THREAD_LIBS_INIT}
#${THREADS_LIB}
#${GFLAGS_LIB}
${
GFLAGS_LIBRARY
}
${
PROTOBUF_LIB
}
${
LEVELDB_LIB
}
${
PROTOC_LIB
}
rt
ssl
crypto
dl
z
${
PROTOC_LIB
}
)
if
(
WITH_GLOG
)
...
...
test/CMakeLists.txt
View file @
997522bc
...
...
@@ -16,7 +16,8 @@ endforeach()
find_path
(
GTEST_HEADER NAMES gtest/gtest.h
)
find_library
(
GTEST_LIB NAMES gtest
)
set
(
CMAKE_CPP_FLAGS
"
${
CMAKE_CPP_FLAGS
}
-DBTHREAD_USE_FAST_PTHREAD_MUTEX -D__const__= -D_GNU_SOURCE -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DUNIT_TEST -Dprivate=public -Dprotected=public -DBVAR_NOT_LINK_DEFAULT_VARIABLES --include
${
CMAKE_SOURCE_DIR
}
/test/sstream_workaround.h"
)
message
(
"h=
${
CMAKE_SOURCE_DIR
}
/test/sstream_workaround.h"
)
set
(
CMAKE_CPP_FLAGS
"
${
CMAKE_CPP_FLAGS
}
-DBTHREAD_USE_FAST_PTHREAD_MUTEX -D__const__= -D_GNU_SOURCE -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DUNIT_TEST -Dprivate=public -Dprotected=public -DBVAR_NOT_LINK_DEFAULT_VARIABLES -include
${
CMAKE_SOURCE_DIR
}
/test/sstream_workaround.h"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CPP_FLAGS
}
-O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer -std=c++0x"
)
...
...
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