Commit 06eb0356 authored by zyearn's avatar zyearn

- Remove weak symbol _RegisterThriftProtocol in CMakeLists.txt

- find libthrift* in example when using brpc with thrift protocol
  enabled
parent 214017b8
...@@ -39,7 +39,8 @@ endif() ...@@ -39,7 +39,8 @@ endif()
if(WITH_THRIFT) if(WITH_THRIFT)
set(THRIFT_CPP_FLAG "-DENABLE_THRIFT_FRAMED_PROTOCOL") set(THRIFT_CPP_FLAG "-DENABLE_THRIFT_FRAMED_PROTOCOL")
set(THRIFT_LIB "thriftnb") set(THRIFTNB_LIB "thriftnb")
set(THRIFT_LIB "thrift")
endif() endif()
include(GNUInstallDirs) include(GNUInstallDirs)
...@@ -156,6 +157,7 @@ set(DYNAMIC_LIB ...@@ -156,6 +157,7 @@ set(DYNAMIC_LIB
${PROTOC_LIB} ${PROTOC_LIB}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${THRIFT_LIB} ${THRIFT_LIB}
${THRIFTNB_LIB}
${OPENSSL_LIBRARIES} ${OPENSSL_LIBRARIES}
${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}
dl dl
...@@ -182,8 +184,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -182,8 +184,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
# for *.so # for *.so
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB ...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(asynchronous_echo_client client.cpp ${PROTO_SRC}) add_executable(asynchronous_echo_client client.cpp ${PROTO_SRC})
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB ...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(backup_request_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(backup_request_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB ...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(cancel_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(cancel_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -15,6 +15,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -15,6 +15,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -90,6 +101,8 @@ set(DYNAMIC_LIB ...@@ -90,6 +101,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -104,8 +117,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -104,8 +117,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(cascade_echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(cascade_echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -20,6 +20,17 @@ find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h) ...@@ -20,6 +20,17 @@ find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h)
find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler) find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler)
include_directories(${GPERFTOOLS_INCLUDE_DIR}) include_directories(${GPERFTOOLS_INCLUDE_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB ...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(dynamic_partition_echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(dynamic_partition_echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -94,6 +105,8 @@ set(DYNAMIC_LIB ...@@ -94,6 +105,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -108,8 +121,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -108,8 +121,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
target_link_libraries(echo_client ${BRPC_LIB} ${DYNAMIC_LIB}) target_link_libraries(echo_client ${BRPC_LIB} ${DYNAMIC_LIB})
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB ...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(echo_hulu_pbrpc_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(echo_hulu_pbrpc_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB ...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(echo_sofa_pbrpc_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(echo_sofa_pbrpc_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB ...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
execute_process( execute_process(
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER http.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER http.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h) find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h)
find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler) find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler)
include_directories(${GPERFTOOLS_INCLUDE_DIR}) include_directories(${GPERFTOOLS_INCLUDE_DIR})
...@@ -97,6 +108,8 @@ set(DYNAMIC_LIB ...@@ -97,6 +108,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -111,8 +124,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -111,8 +124,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(http_client http_client.cpp) add_executable(http_client http_client.cpp)
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB ...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(memcache_client client.cpp) add_executable(memcache_client client.cpp)
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h) find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h)
find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler) find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler)
include_directories(${GPERFTOOLS_INCLUDE_DIR}) include_directories(${GPERFTOOLS_INCLUDE_DIR})
...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB ...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(multi_threaded_echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(multi_threaded_echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h) find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h)
find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler) find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler)
include_directories(${GPERFTOOLS_INCLUDE_DIR}) include_directories(${GPERFTOOLS_INCLUDE_DIR})
...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB ...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(multi_threaded_echo_fns_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(multi_threaded_echo_fns_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h) find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h)
find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler) find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler)
include_directories(${GPERFTOOLS_INCLUDE_DIR}) include_directories(${GPERFTOOLS_INCLUDE_DIR})
...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB ...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
execute_process( execute_process(
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB ...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(nshead_extension_client client.cpp) add_executable(nshead_extension_client client.cpp)
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB ...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(nshead_pb_extension_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(nshead_pb_extension_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h) find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h)
find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler) find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler)
include_directories(${GPERFTOOLS_INCLUDE_DIR}) include_directories(${GPERFTOOLS_INCLUDE_DIR})
...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB ...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(parallel_echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(parallel_echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h) find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h)
find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler) find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler)
include_directories(${GPERFTOOLS_INCLUDE_DIR}) include_directories(${GPERFTOOLS_INCLUDE_DIR})
...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB ...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -21,6 +21,17 @@ set(CMAKE_PREFIX_PATH ${OUTPUT_PATH}) ...@@ -21,6 +21,17 @@ set(CMAKE_PREFIX_PATH ${OUTPUT_PATH})
include(FindThreads) include(FindThreads)
include(FindProtobuf) include(FindProtobuf)
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB ...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(redis_cli redis_cli.cpp) add_executable(redis_cli redis_cli.cpp)
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h) find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h)
find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler) find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler)
include_directories(${GPERFTOOLS_INCLUDE_DIR}) include_directories(${GPERFTOOLS_INCLUDE_DIR})
...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB ...@@ -96,6 +107,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -110,8 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(selective_echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(selective_echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h) find_path(GPERFTOOLS_INCLUDE_DIR NAMES gperftools/heap-profiler.h)
find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler) find_library(GPERFTOOLS_LIBRARIES NAMES tcmalloc_and_profiler)
include_directories(${GPERFTOOLS_INCLUDE_DIR}) include_directories(${GPERFTOOLS_INCLUDE_DIR})
...@@ -103,6 +114,8 @@ set(DYNAMIC_LIB ...@@ -103,6 +114,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -117,8 +130,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -117,8 +130,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(session_data_and_thread_local_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(session_data_and_thread_local_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto) ...@@ -16,6 +16,17 @@ protobuf_generate_cpp(PROTO_SRC PROTO_HEADER echo.proto)
# include PROTO_HEADER # include PROTO_HEADER
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Search for libthrift* by best effort. If it is not found and brpc is
# compiled with thrift protocol enabled, a link error would be reported.
find_library(THRIFT_LIB NAMES thrift)
if (NOT THRIFT_LIB)
set(THRIFT_LIB "")
endif()
find_library(THRIFTNB_LIB NAMES thriftnb)
if (NOT THRIFTNB_LIB)
set(THRIFTNB_LIB "")
endif()
find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h) find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
if(EXAMPLE_LINK_SO) if(EXAMPLE_LINK_SO)
find_library(BRPC_LIB NAMES brpc) find_library(BRPC_LIB NAMES brpc)
...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB ...@@ -91,6 +102,8 @@ set(DYNAMIC_LIB
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${SSL_LIB}
${CRYPTO_LIB} ${CRYPTO_LIB}
${THRIFT_LIB}
${THRIFTNB_LIB}
dl dl
) )
...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -105,8 +118,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
add_executable(streaming_echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(streaming_echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#endif #endif
extern "C" { extern "C" {
void bthread_assign_data(void* data) __THROW; void bthread_assign_data(void* data);
} }
namespace brpc { namespace brpc {
......
...@@ -98,7 +98,7 @@ int bthread_id_lock_verbose(bthread_id_t id, void** pdata, ...@@ -98,7 +98,7 @@ int bthread_id_lock_verbose(bthread_id_t id, void** pdata,
const char *location); const char *location);
// Lock `id' (for using the data exclusively) and reset the range. If `id' is // Lock `id' (for using the data exclusively) and reset the range. If `id' is
// locked by others, wait until `id' is unlocked or destroyed. if `range' if // locked by others, wait until `id' is unlocked or destroyed. if `range' is
// smaller than the original range of this id, nothing happens about the range // smaller than the original range of this id, nothing happens about the range
#define bthread_id_lock_and_reset_range(id, pdata, range) \ #define bthread_id_lock_and_reset_range(id, pdata, range) \
bthread_id_lock_and_reset_range_verbose(id, pdata, range, \ bthread_id_lock_and_reset_range_verbose(id, pdata, range, \
......
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