Unverified Commit 4c400a16 authored by Ge Jun's avatar Ge Jun Committed by GitHub

Merge pull request #620 from zyearn/fix_cmake_glog

fix glog name problem in cmake
parents 1aeef03c 6295344d
......@@ -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()
......@@ -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()
......
#ifndef BUTIL_CONFIG_H
#define BUTIL_CONFIG_H
#ifdef BRPC_WITH_GLOG
#undef BRPC_WITH_GLOG
#endif
#cmakedefine BRPC_WITH_GLOG @WITH_GLOG_VAL@
#endif // BUTIL_CONFIG_H
......@@ -14,7 +14,7 @@
// Authors: Ge,Jun (gejun@baidu.com)
#if !BRPC_WITH_GLOG
#if !BRPC_WITH_GLOG
#include "brpc/log.h"
#include "brpc/controller.h" // Controller
......
......@@ -17,11 +17,11 @@
#ifndef BRPC_VLOG_SERVICE_H
#define BRPC_VLOG_SERVICE_H
#if !BRPC_WITH_GLOG
#if !BRPC_WITH_GLOG
#include <ostream>
#include "brpc/builtin_service.pb.h"
namespace brpc {
class VLogService : public vlog {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment