File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -77,9 +77,14 @@ Status StubGenerator::GenerateHeader() {
7777 std::vector<std::string> mixin_headers =
7878 absl::StrSplit (vars (" mixin_proto_grpc_header_paths" ), ' ,' );
7979 HeaderSystemIncludes (mixin_headers);
80+ bool include_lro_header =
81+ HasLongrunningMethod () &&
82+ std::find (mixin_headers.begin (), mixin_headers.end (),
83+ " google/longrunning/operations.grpc.pb.h" ) ==
84+ mixin_headers.end ();
8085 HeaderSystemIncludes (
8186 {vars (" proto_grpc_header_path" ),
82- HasLongrunningMethod () ? " google/longrunning/operations.grpc.pb.h" : " " ,
87+ include_lro_header ? " google/longrunning/operations.grpc.pb.h" : " " ,
8388 " memory" , " utility" });
8489
8590 auto result = HeaderOpenNamespaces (NamespaceType::kInternal );
Original file line number Diff line number Diff line change @@ -58,11 +58,15 @@ Status StubRestGenerator::GenerateHeader() {
5858 std::vector<std::string> mixin_headers =
5959 absl::StrSplit (vars (" mixin_proto_header_paths" ), ' ,' );
6060 HeaderSystemIncludes (mixin_headers);
61- HeaderSystemIncludes ({vars (" proto_header_path" ),
62- HasLongrunningMethod ()
63- ? vars (" longrunning_operation_include_header" )
64- : " " ,
65- " memory" });
61+ bool include_lro_header =
62+ HasLongrunningMethod () &&
63+ std::find (mixin_headers.begin (), mixin_headers.end (),
64+ vars (" longrunning_operation_include_header" )) ==
65+ mixin_headers.end ();
66+ HeaderSystemIncludes (
67+ {vars (" proto_header_path" ),
68+ include_lro_header ? vars (" longrunning_operation_include_header" ) : " " ,
69+ " memory" });
6670
6771 auto result = HeaderOpenNamespaces (NamespaceType::kInternal );
6872 if (!result.ok ()) return result;
You can’t perform that action at this time.
0 commit comments