diff options
author | Muxi Yan <mxyan@google.com> | 2018-02-20 14:05:33 -0800 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2018-02-21 16:33:44 -0800 |
commit | 6be15eef08759470fedece4b86afaae848a38303 (patch) | |
tree | 7eef94c102f1507d1d3f4f5c5eec2ac3b9f45254 /templates | |
parent | d555bd85435ea79f74a58c519dd71a5bb65c7f7a (diff) |
Patch gRPC-C++.podspec to support framework
Diffstat (limited to 'templates')
-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 |