diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d878ae7c76..aec2e1ba881 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,7 @@ set(gRPC_INSTALL_SHAREDIR "share/grpc" CACHE STRING "Installation directory for # Options option(gRPC_BUILD_TESTS "Build tests" OFF) option(gRPC_BUILD_CODEGEN "Build codegen" ON) +option(gRPC_BUILD_CSHARP_EXT "Build C# extensions" ON) set(gRPC_INSTALL_default ON) if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) @@ -5177,6 +5178,7 @@ target_link_libraries(qps endif (gRPC_BUILD_CODEGEN) endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_CSHARP_EXT) add_library(grpc_csharp_ext SHARED src/csharp/ext/grpc_csharp_ext.c @@ -5223,6 +5225,7 @@ if (gRPC_INSTALL) ) endif() +endif (gRPC_BUILD_CSHARP_EXT) if (gRPC_BUILD_TESTS) add_library(bad_client_test diff --git a/src/cpp/ext/filters/census/client_filter.cc b/src/cpp/ext/filters/census/client_filter.cc index 293f4b1c253..940d42d1000 100644 --- a/src/cpp/ext/filters/census/client_filter.cc +++ b/src/cpp/ext/filters/census/client_filter.cc @@ -119,8 +119,10 @@ void CensusClientCallData::StartTransportStreamOpBatch( } if (op->recv_trailing_metadata() != nullptr) { recv_trailing_metadata_ = op->recv_trailing_metadata()->batch(); - initial_on_done_recv_trailing_metadata_ = op->on_complete(); - op->set_on_complete(&on_done_recv_trailing_metadata_); + initial_on_done_recv_trailing_metadata_ = + op->op()->payload->recv_trailing_metadata.recv_trailing_metadata_ready; + op->op()->payload->recv_trailing_metadata.recv_trailing_metadata_ready = + &on_done_recv_trailing_metadata_; } // Call next op. grpc_call_next_op(elem, op->op()); diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index a7f59e15a7b..de13d02e2a3 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -87,6 +87,7 @@ # Options option(gRPC_BUILD_TESTS "Build tests" OFF) option(gRPC_BUILD_CODEGEN "Build codegen" ON) + option(gRPC_BUILD_CSHARP_EXT "Build C# extensions" ON) set(gRPC_INSTALL_default ON) if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) @@ -298,6 +299,11 @@ if (gRPC_BUILD_TESTS) ${cc_library(lib)} endif (gRPC_BUILD_TESTS) + % elif lib.name in ['grpc_csharp_ext']: + if (gRPC_BUILD_CSHARP_EXT) + ${cc_library(lib)} + ${cc_install(lib)} + endif (gRPC_BUILD_CSHARP_EXT) % else: ${cc_library(lib)} % if not lib.build in ["tool"]: