diff options
Diffstat (limited to 'templates/gRPC-C++.podspec.template')
-rw-r--r-- | templates/gRPC-C++.podspec.template | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/templates/gRPC-C++.podspec.template b/templates/gRPC-C++.podspec.template index 78adb27915..c24afea09c 100644 --- a/templates/gRPC-C++.podspec.template +++ b/templates/gRPC-C++.podspec.template @@ -30,6 +30,9 @@ out += lib.get(group, []) return out + def filter_grpcpp(files): + return [file for file in files if not file.startswith("include/grpc++")] + def grpc_private_files(libs): out = grpc_lib_files(libs, ("grpc", "gpr"), ("headers", "src")) return out @@ -59,6 +62,9 @@ # Since some C++ source files directly included private headers in C core, we include all the # C core headers in C++ Implementation subspec as well. out += [file for file in grpc_private_headers(libs) if not file.startswith("third_party/nanopb/")] + + out = filter_grpcpp(out) + return out def grpcpp_private_headers(libs, filegroups): @@ -71,6 +77,8 @@ # Since some C++ source files directly included private headers in C core, we intentionally # keep the C core headers in \a out. But we should exclude nanopb headers. out = [file for file in out if not file.startswith("third_party/nanopb/")] + + out = filter_grpcpp(out) return out def grpcpp_public_headers(libs, filegroups): @@ -81,6 +89,9 @@ excl_files += grpcpp_proto_files(filegroups) out = [file for file in out if file not in excl_files] + + out = filter_grpcpp(out) + return out def grpc_test_util_files(libs): @@ -136,8 +147,14 @@ s.osx.deployment_target = '10.9' s.requires_arc = false - # Add include prefix `grpc++` (i.e. `#include <grpc++/xxx.h>`). - s.header_dir = 'grpc++' + name = 'grpcpp' + # Use `grpcpp` as framework name so that `#include <grpcpp/xxx.h>` works when built as + # framework. + s.module_name = name + + # Add include prefix `grpcpp` so that `#include <grpcpp/xxx.h>` works when built as static + # library. + s.header_dir = name s.pod_target_xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(PODS_TARGET_SRCROOT)/include"', @@ -158,7 +175,7 @@ s.default_subspecs = 'Interface', 'Implementation' s.subspec 'Interface' do |ss| - ss.header_mappings_dir = 'include/grpc++' + ss.header_mappings_dir = 'include/grpcpp' ss.source_files = ${ruby_multiline_list(grpcpp_public_headers(libs, filegroups), 22)} end |