Commit 8041feee authored by zhujiashun's avatar zhujiashun

change the way of finding threads

parent c20a32e8
...@@ -61,13 +61,14 @@ if(NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)) ...@@ -61,13 +61,14 @@ if(NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))
endif() endif()
#find_package(Threads REQUIRED) #find_package(Threads REQUIRED)
include(FindThreads)
#find_path(GFLAGS_HEADER NAMES gflags/gflags.h) #find_path(GFLAGS_HEADER NAMES gflags/gflags.h)
#find_library(GFLAGS_LIB NAMES gflags) #find_library(GFLAGS_LIB NAMES gflags)
#find_package(gflags REQUIRED) #find_package(gflags REQUIRED)
find_path(THREADS_HEADER NAMES pthread.h) #find_path(THREADS_HEADER NAMES pthread.h)
find_library(THREADS_LIB NAMES pthread) #find_library(THREADS_LIB NAMES pthread)
find_path(PROTOBUF_HEADER NAMES google/protobuf/stubs/common.h) find_path(PROTOBUF_HEADER NAMES google/protobuf/stubs/common.h)
find_library(PROTOBUF_LIB NAMES protobuf) find_library(PROTOBUF_LIB NAMES protobuf)
...@@ -88,7 +89,7 @@ include_directories( ...@@ -88,7 +89,7 @@ include_directories(
${PROTOBUF_HEADER} ${PROTOBUF_HEADER}
${LEVELDB_HEADER} ${LEVELDB_HEADER}
${THREAD_HEADER} ${THREAD_HEADER}
${THREADS_HEADER} #${THREADS_HEADER}
) )
# for *.so # for *.so
......
...@@ -27,7 +27,7 @@ fi ...@@ -27,7 +27,7 @@ fi
echo "start building by cmake" echo "start building by cmake"
rm -rf build && mkdir build && cd build rm -rf build && mkdir build && cd build
if ! cmake -DBRPC_DEBUG=OFF -BUILD_EXAMPLE=ON -BUILD_UNIT_TESTS=OFF ..; then if ! cmake -DBRPC_DEBUG=OFF -DBUILD_EXAMPLE=ON -DBUILD_UNIT_TESTS=OFF ..; then
echo "Fail to generate Makefile by cmake" echo "Fail to generate Makefile by cmake"
exit 1 exit 1
fi fi
......
...@@ -191,8 +191,8 @@ add_library(brpc SHARED ${SOURCES}) ...@@ -191,8 +191,8 @@ add_library(brpc SHARED ${SOURCES})
add_library(brpc_static STATIC ${SOURCES}) add_library(brpc_static STATIC ${SOURCES})
target_link_libraries(brpc target_link_libraries(brpc
#${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${THREADS_LIB} #${THREADS_LIB}
#${GFLAGS_LIB} #${GFLAGS_LIB}
${GFLAGS_LIBRARY} ${GFLAGS_LIBRARY}
${PROTOBUF_LIB} ${PROTOBUF_LIB}
......
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