aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt111
1 files changed, 111 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 049a88b5dc..428bdc7773 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -763,6 +763,7 @@ endif()
add_dependencies(buildtests_cxx server_crash_test_client)
add_dependencies(buildtests_cxx server_request_call_test)
add_dependencies(buildtests_cxx shutdown_test)
+add_dependencies(buildtests_cxx stats_test)
add_dependencies(buildtests_cxx status_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx streaming_throughput_test)
@@ -2772,6 +2773,68 @@ if (gRPC_INSTALL)
)
endif()
+if (gRPC_BUILD_TESTS)
+
+add_library(grpc++_core_stats
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/core/stats.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/core/stats.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/core/stats.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/core/stats.grpc.pb.h
+ src/cpp/util/core_stats.cc
+)
+
+if(WIN32 AND MSVC)
+ set_target_properties(grpc++_core_stats PROPERTIES COMPILE_PDB_NAME "grpc++_core_stats"
+ COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
+ )
+ if (gRPC_INSTALL)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc++_core_stats.pdb
+ DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL
+ )
+ endif()
+endif()
+
+protobuf_generate_grpc_cpp(
+ src/proto/grpc/core/stats.proto
+)
+
+target_include_directories(grpc++_core_stats
+ PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${BORINGSSL_ROOT_DIR}/include
+ PRIVATE ${PROTOBUF_ROOT_DIR}/src
+ PRIVATE ${ZLIB_INCLUDE_DIR}
+ PRIVATE ${BENCHMARK}/include
+ PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
+ PRIVATE ${CARES_BUILD_INCLUDE_DIR}
+ PRIVATE ${CARES_INCLUDE_DIR}
+ PRIVATE ${CARES_PLATFORM_INCLUDE_DIR}
+ PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
+ PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
+ PRIVATE third_party/googletest/googletest/include
+ PRIVATE third_party/googletest/googletest
+ PRIVATE third_party/googletest/googlemock/include
+ PRIVATE third_party/googletest/googlemock
+ PRIVATE ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(grpc++_core_stats
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++
+)
+
+foreach(_hdr
+ src/cpp/util/core_stats.h
+)
+ string(REPLACE "include/" "" _path ${_hdr})
+ get_filename_component(_path ${_path} PATH)
+ install(FILES ${_hdr}
+ DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
+ )
+endforeach()
+
+endif (gRPC_BUILD_TESTS)
add_library(grpc++_cronet
src/cpp/client/cronet_credentials.cc
@@ -4597,6 +4660,7 @@ target_link_libraries(qps
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc++_test_util
+ grpc++_core_stats
grpc++
grpc
)
@@ -10496,6 +10560,7 @@ target_include_directories(codegen_test_full
target_link_libraries(codegen_test_full
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_core_stats
grpc++
grpc
gpr
@@ -10571,6 +10636,7 @@ target_include_directories(codegen_test_minimal
target_link_libraries(codegen_test_minimal
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_core_stats
grpc
gpr
${_gRPC_GFLAGS_LIBRARIES}
@@ -12142,6 +12208,7 @@ target_link_libraries(qps_json_driver
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
qps
+ grpc++_core_stats
grpc++_test_util
grpc_test_util
grpc++
@@ -12187,6 +12254,7 @@ target_link_libraries(qps_openloop_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
qps
+ grpc++_core_stats
grpc++_test_util
grpc_test_util
grpc++
@@ -12232,6 +12300,7 @@ target_link_libraries(qps_worker
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
qps
+ grpc++_core_stats
grpc++_test_util
grpc_test_util
grpc++
@@ -12449,6 +12518,7 @@ target_link_libraries(secure_sync_unary_ping_pong_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
qps
+ grpc++_core_stats
grpc++_test_util
grpc_test_util
grpc++
@@ -12786,6 +12856,47 @@ target_link_libraries(shutdown_test
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
+add_executable(stats_test
+ test/core/debug/stats_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+
+target_include_directories(stats_test
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
+ PRIVATE ${BORINGSSL_ROOT_DIR}/include
+ PRIVATE ${PROTOBUF_ROOT_DIR}/src
+ PRIVATE ${BENCHMARK_ROOT_DIR}/include
+ PRIVATE ${ZLIB_ROOT_DIR}
+ PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
+ PRIVATE ${CARES_BUILD_INCLUDE_DIR}
+ PRIVATE ${CARES_INCLUDE_DIR}
+ PRIVATE ${CARES_PLATFORM_INCLUDE_DIR}
+ PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
+ PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
+ PRIVATE third_party/googletest/googletest/include
+ PRIVATE third_party/googletest/googletest
+ PRIVATE third_party/googletest/googlemock/include
+ PRIVATE third_party/googletest/googlemock
+ PRIVATE ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(stats_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_util
+ grpc_test_util
+ grpc
+ gpr_test_util
+ gpr
+ ${_gRPC_GFLAGS_LIBRARIES}
+)
+
+endif (gRPC_BUILD_TESTS)
+if (gRPC_BUILD_TESTS)
+
add_executable(status_test
test/cpp/util/status_test.cc
third_party/googletest/googletest/src/gtest-all.cc