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
817a3530
Commit
817a3530
authored
Jan 14, 2019
by
zhujiashun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revise WITH_GLOG TO BRPC_WITH_GLOG in CMakeLists.txt
parent
c9c901b8
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
15 deletions
+15
-15
CMakeLists.txt
CMakeLists.txt
+5
-5
config.h.in
config.h.in
+1
-1
vlog_service.cpp
src/brpc/builtin/vlog_service.cpp
+1
-1
vlog_service.h
src/brpc/builtin/vlog_service.h
+2
-2
server.cpp
src/brpc/server.cpp
+1
-1
logging.cc
src/butil/logging.cc
+2
-2
logging.h
src/butil/logging.h
+3
-3
No files found.
CMakeLists.txt
View file @
817a3530
...
...
@@ -22,14 +22,14 @@ 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_
WITH_GLOG
"With glog"
OFF
)
option
(
DEBUG
"Print debug logs"
OFF
)
option
(
WITH_DEBUG_SYMBOLS
"With debug symbols"
ON
)
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
(
WITH_GLOG
)
if
(
BRPC_
WITH_GLOG
)
set
(
WITH_GLOG_VAL
"1"
)
endif
()
...
...
@@ -80,7 +80,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
endif
()
endif
()
set
(
CMAKE_CPP_FLAGS
"
${
DEFINE_CLOCK_GETTIME
}
-DWITH_GLOG=
${
WITH_GLOG_VAL
}
-DGFLAGS_NS=
${
GFLAGS_NS
}
"
)
set
(
CMAKE_CPP_FLAGS
"
${
DEFINE_CLOCK_GETTIME
}
-D
BRPC_
WITH_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"
)
...
...
@@ -121,7 +121,7 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB))
message
(
FATAL_ERROR
"Fail to find leveldb"
)
endif
()
if
(
WITH_GLOG
)
if
(
BRPC_
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
))
...
...
@@ -165,7 +165,7 @@ set(DYNAMIC_LIB
)
set
(
BRPC_PRIVATE_LIBS
"-lgflags -lprotobuf -lleveldb -lprotoc -lssl -lcrypto -ldl -lz"
)
if
(
WITH_GLOG
)
if
(
BRPC_
WITH_GLOG
)
set
(
DYNAMIC_LIB
${
DYNAMIC_LIB
}
${
GLOG_LIB
}
)
set
(
BRPC_PRIVATE_LIBS
"
${
BRPC_PRIVATE_LIBS
}
-lglog"
)
endif
()
...
...
config.h.in
View file @
817a3530
#ifndef BUTIL_CONFIG_H
#define BUTIL_CONFIG_H
#cmakedefine WITH_GLOG @WITH_GLOG_VAL@
#cmakedefine
BRPC_
WITH_GLOG @WITH_GLOG_VAL@
#endif // BUTIL_CONFIG_H
src/brpc/builtin/vlog_service.cpp
View file @
817a3530
...
...
@@ -14,7 +14,7 @@
// Authors: Ge,Jun (gejun@baidu.com)
#if !WITH_GLOG
#if !
BRPC_
WITH_GLOG
#include "brpc/log.h"
#include "brpc/controller.h" // Controller
...
...
src/brpc/builtin/vlog_service.h
View file @
817a3530
...
...
@@ -17,7 +17,7 @@
#ifndef BRPC_VLOG_SERVICE_H
#define BRPC_VLOG_SERVICE_H
#if !WITH_GLOG
#if !
BRPC_
WITH_GLOG
#include <ostream>
#include "brpc/builtin_service.pb.h"
...
...
@@ -35,6 +35,6 @@ public:
}
// namespace brpc
#endif // WITH_GLOG
#endif //
BRPC_
WITH_GLOG
#endif //BRPC_VLOG_SERVICE_H
src/brpc/server.cpp
View file @
817a3530
...
...
@@ -497,7 +497,7 @@ int Server::AddBuiltinServices() {
return
-
1
;
}
#if !WITH_GLOG
#if !
BRPC_
WITH_GLOG
if
(
AddBuiltinService
(
new
(
std
::
nothrow
)
VLogService
))
{
LOG
(
ERROR
)
<<
"Fail to add VLogService"
;
return
-
1
;
...
...
src/butil/logging.cc
View file @
817a3530
...
...
@@ -17,7 +17,7 @@
#include "butil/logging.h"
#if !WITH_GLOG
#if !
BRPC_
WITH_GLOG
#if defined(OS_WIN)
#include <io.h>
...
...
@@ -1440,4 +1440,4 @@ std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
return
out
<<
butil
::
WideToUTF8
(
std
::
wstring
(
wstr
));
}
#endif // WITH_GLOG
#endif //
BRPC_
WITH_GLOG
src/butil/logging.h
View file @
817a3530
...
...
@@ -20,7 +20,7 @@
#ifndef BUTIL_LOGGING_H_
#define BUTIL_LOGGING_H_
#include "butil/config.h" // WITH_GLOG
#include "butil/config.h" //
BRPC_
WITH_GLOG
#include <inttypes.h>
#include <string>
...
...
@@ -30,7 +30,7 @@
#include "butil/atomicops.h" // Used by LOG_EVERY_N, LOG_FIRST_N etc
#include "butil/time.h" // gettimeofday_us()
#if WITH_GLOG
#if
BRPC_
WITH_GLOG
# include <glog/logging.h>
# include <glog/raw_logging.h>
// define macros that not implemented in glog
...
...
@@ -1096,7 +1096,7 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
// 4 -- [default] LOG(ERROR) at runtime
// 5 -- LOG(ERROR) at runtime, only once per call-site
#endif // WITH_GLOG
#endif //
BRPC_
WITH_GLOG
#ifndef NOTIMPLEMENTED_POLICY
#if defined(OS_ANDROID) && defined(OFFICIAL_BUILD)
...
...
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