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
51a58ccc
Commit
51a58ccc
authored
Jul 04, 2018
by
wangxuefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unify Marco both with config_brpc.sh and cmake
parent
c53d23ae
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
CMakeLists.txt
CMakeLists.txt
+8
-8
config_brpc.sh
config_brpc.sh
+2
-2
thrift.md
docs/cn/thrift.md
+1
-1
thrift.md
docs/en/thrift.md
+1
-1
No files found.
CMakeLists.txt
View file @
51a58ccc
...
...
@@ -22,14 +22,14 @@ else()
message
(
WARNING
"You are using an unsupported compiler! Compilation has only been tested with Clang and GCC."
)
endif
()
option
(
BRPC_
WITH_GLOG
"With glog"
OFF
)
option
(
WITH_GLOG
"With glog"
OFF
)
option
(
DEBUG
"Print debug logs"
OFF
)
option
(
WITH_DEBUG_SYMBOLS
"With debug symbols"
ON
)
option
(
BRPC_
WITH_THRIFT
"With thrift framed protocol supported"
OFF
)
option
(
WITH_THRIFT
"With thrift framed protocol supported"
OFF
)
option
(
BUILD_UNIT_TESTS
"Whether to build unit tests"
OFF
)
set
(
WITH_GLOG_VAL
"0"
)
if
(
BRPC_
WITH_GLOG
)
if
(
WITH_GLOG
)
set
(
WITH_GLOG_VAL
"1"
)
endif
()
...
...
@@ -37,7 +37,7 @@ if(WITH_DEBUG_SYMBOLS)
set
(
DEBUG_SYMBOL
"-g"
)
endif
()
if
(
BRPC_
WITH_THRIFT
)
if
(
WITH_THRIFT
)
set
(
THRIFT_CPP_FLAG
"-DENABLE_THRIFT_FRAMED_PROTOCOL"
)
set
(
THRIFT_LIB
"thriftnb"
)
endif
()
...
...
@@ -79,7 +79,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
endif
()
endif
()
set
(
CMAKE_CPP_FLAGS
"
${
DEFINE_CLOCK_GETTIME
}
-D
BRPC_
WITH_GLOG=
${
WITH_GLOG_VAL
}
-DGFLAGS_NS=
${
GFLAGS_NS
}
"
)
set
(
CMAKE_CPP_FLAGS
"
${
DEFINE_CLOCK_GETTIME
}
-DWITH_GLOG=
${
WITH_GLOG_VAL
}
-DGFLAGS_NS=
${
GFLAGS_NS
}
"
)
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 -DBRPC_REVISION=
\\\"
${
BRPC_REVISION
}
\\\"
-D__STRICT_ANSI__"
)
set
(
CMAKE_CPP_FLAGS
"
${
CMAKE_CPP_FLAGS
}
${
DEBUG_SYMBOL
}
${
THRIFT_CPP_FLAG
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CPP_FLAGS
}
-O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer"
)
...
...
@@ -120,7 +120,7 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB))
message
(
FATAL_ERROR
"Fail to find leveldb"
)
endif
()
if
(
BRPC_
WITH_GLOG
)
if
(
WITH_GLOG
)
find_path
(
GLOG_INCLUDE_PATH NAMES glog/logging.h
)
find_library
(
GLOG_LIB NAMES glog
)
if
((
NOT GLOG_INCLUDE_PATH
)
OR
(
NOT GLOG_LIB
))
...
...
@@ -163,7 +163,7 @@ set(DYNAMIC_LIB
)
set
(
BRPC_PRIVATE_LIBS
"-lgflags -lprotobuf -lleveldb -lprotoc -lssl -lcrypto -ldl -lz"
)
if
(
BRPC_
WITH_GLOG
)
if
(
WITH_GLOG
)
set
(
DYNAMIC_LIB
${
DYNAMIC_LIB
}
${
GLOG_LIB
}
)
set
(
BRPC_PRIVATE_LIBS
"
${
BRPC_PRIVATE_LIBS
}
-lglog"
)
endif
()
...
...
@@ -329,7 +329,7 @@ file(GLOB_RECURSE JSON2PB_SOURCES "${CMAKE_SOURCE_DIR}/src/json2pb/*.cpp")
file
(
GLOB_RECURSE BRPC_SOURCES
"
${
CMAKE_SOURCE_DIR
}
/src/brpc/*.cpp"
)
file
(
GLOB_RECURSE THRIFT_SOURCES
"thrift*.cpp"
)
if
(
BRPC_
WITH_THRIFT
)
if
(
WITH_THRIFT
)
message
(
"brpc compile with thrift proctol"
)
else
()
# Remove thrift sources
...
...
config_brpc.sh
View file @
51a58ccc
...
...
@@ -34,8 +34,8 @@ eval set -- "$TEMP"
# Convert to abspath always so that generated mk is include-able from everywhere
while
true
;
do
case
"
$1
"
in
--headers
)
HDRS_IN
=
"
$(
rea
lpath
$2
)
"
;
shift
2
;;
--libs
)
LIBS_IN
=
"
$(
rea
lpath
$2
)
"
;
shift
2
;;
--headers
)
HDRS_IN
=
"
$(
rea
dlink
-e
$2
)
"
;
shift
2
;;
--libs
)
LIBS_IN
=
"
$(
rea
dlink
-e
$2
)
"
;
shift
2
;;
--cc
)
CC
=
$2
;
shift
2
;;
--cxx
)
CXX
=
$2
;
shift
2
;;
--with-glog
)
WITH_GLOG
=
1
;
shift
1
;;
...
...
docs/cn/thrift.md
View file @
51a58ccc
...
...
@@ -29,7 +29,7 @@ sudo make install
```
bash
sh config_brpc.sh
--headers
=
/usr/include
--libs
=
/usr/lib
--with-thrift
#或者使用cmake
mkdir
build
&&
cd
build
&&
cmake ../
-D
BRPC_
WITH_THRIFT
=
1
mkdir
build
&&
cd
build
&&
cmake ../
-DWITH_THRIFT
=
1
```
# Client端访问thrift server
...
...
docs/en/thrift.md
View file @
51a58ccc
...
...
@@ -29,7 +29,7 @@ Config brpc with thrift support, then make. The compiled libbrpc.a includes exte
```
bash
sh config_brpc.sh
--headers
=
/usr/include
--libs
=
/usr/lib
--with-thrift
#or use cmake
mkdir
build
&&
cd
build
&&
cmake ../
-D
BRPC_
WITH_THRIFT
=
1
mkdir
build
&&
cd
build
&&
cmake ../
-DWITH_THRIFT
=
1
```
# Client accesses thrift server
...
...
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