Unverified Commit 303cd576 authored by Ge Jun's avatar Ge Jun Committed by GitHub

Merge pull request #621 from zyearn/fix_cmake_glog

update cmake docs after fixing pull/620
parents 4c400a16 9b5c24f6
...@@ -22,15 +22,16 @@ else() ...@@ -22,15 +22,16 @@ else()
message(WARNING "You are using an unsupported compiler! Compilation has only been tested with Clang and GCC.") message(WARNING "You are using an unsupported compiler! Compilation has only been tested with Clang and GCC.")
endif() endif()
option(BRPC_WITH_GLOG "With glog" OFF) option(WITH_GLOG "With glog" OFF)
option(DEBUG "Print debug logs" OFF) option(DEBUG "Print debug logs" OFF)
option(WITH_DEBUG_SYMBOLS "With debug symbols" ON) option(WITH_DEBUG_SYMBOLS "With debug symbols" ON)
option(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) option(BUILD_UNIT_TESTS "Whether to build unit tests" OFF)
set(WITH_GLOG_VAL "0") set(WITH_GLOG_VAL "0")
if(BRPC_WITH_GLOG) if(WITH_GLOG)
set(WITH_GLOG_VAL "1") set(WITH_GLOG_VAL "1")
set(BRPC_WITH_GLOG 1)
endif() endif()
if(WITH_DEBUG_SYMBOLS) if(WITH_DEBUG_SYMBOLS)
...@@ -121,7 +122,7 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB)) ...@@ -121,7 +122,7 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB))
message(FATAL_ERROR "Fail to find leveldb") message(FATAL_ERROR "Fail to find leveldb")
endif() endif()
if(BRPC_WITH_GLOG) if(WITH_GLOG)
find_path(GLOG_INCLUDE_PATH NAMES glog/logging.h) find_path(GLOG_INCLUDE_PATH NAMES glog/logging.h)
find_library(GLOG_LIB NAMES glog) find_library(GLOG_LIB NAMES glog)
if((NOT GLOG_INCLUDE_PATH) OR (NOT GLOG_LIB)) if((NOT GLOG_INCLUDE_PATH) OR (NOT GLOG_LIB))
...@@ -165,7 +166,7 @@ set(DYNAMIC_LIB ...@@ -165,7 +166,7 @@ set(DYNAMIC_LIB
) )
set(BRPC_PRIVATE_LIBS "-lgflags -lprotobuf -lleveldb -lprotoc -lssl -lcrypto -ldl -lz") 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(DYNAMIC_LIB ${DYNAMIC_LIB} ${GLOG_LIB})
set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lglog") set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lglog")
endif() endif()
......
...@@ -645,7 +645,7 @@ TEST(NamingServiceTest, discovery_sanity) { ...@@ -645,7 +645,7 @@ TEST(NamingServiceTest, discovery_sanity) {
// svc.RenewCount() be one. // svc.RenewCount() be one.
ASSERT_EQ(0, dc.Register(dparam)); ASSERT_EQ(0, dc.Register(dparam));
ASSERT_EQ(0, dc.Register(dparam)); ASSERT_EQ(0, dc.Register(dparam));
bthread_usleep(1000000); bthread_usleep(100000);
} }
ASSERT_EQ(svc.RenewCount(), 1); ASSERT_EQ(svc.RenewCount(), 1);
ASSERT_EQ(svc.CancelCount(), 1); ASSERT_EQ(svc.CancelCount(), 1);
......
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