aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/objective-c/route_guide
diff options
context:
space:
mode:
authorGravatar Jorge Canizales <jcanizales@google.com>2016-07-01 11:54:35 -0700
committerGravatar Jorge Canizales <jcanizales@google.com>2016-07-01 11:54:35 -0700
commit0f213c399c5e4025146cbd6fb2a63925f37e8b82 (patch)
tree0f71d90b4a923cb4d2c6af7876a7d8fc637a3823 /examples/objective-c/route_guide
parent6ec3b532977550d6343920104eefe71440b94790 (diff)
Fix examples to work with local gRPC-Core
Diffstat (limited to 'examples/objective-c/route_guide')
-rw-r--r--examples/objective-c/route_guide/Podfile20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/objective-c/route_guide/Podfile b/examples/objective-c/route_guide/Podfile
index 645309052e..943f5464d8 100644
--- a/examples/objective-c/route_guide/Podfile
+++ b/examples/objective-c/route_guide/Podfile
@@ -21,3 +21,23 @@ target 'RouteGuideClient' do
pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC
pod 'gRPC-ProtoRPC', :path => GRPC_LOCAL_SRC
end
+
+# This pre_install hook is only needed to use the local version of gRPC-Core. You don't need it in
+# your application.
+pre_install do |installer|
+ # This is the gRPC-Core podspec object, as initialized by its podspec file.
+ grpc_core_spec = installer.pod_targets.find{|t| t.name == 'gRPC-Core'}.root_spec
+
+ # Copied from gRPC-Core.podspec, except for the adjusted src_root:
+ src_root = "$(PODS_ROOT)/../#{GRPC_LOCAL_SRC}"
+ grpc_core_spec.pod_target_xcconfig = {
+ 'GRPC_SRC_ROOT' => src_root,
+ 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
+ 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
+ # If we don't set these two settings, `include/grpc/support/time.h` and
+ # `src/core/lib/support/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
+ # build.
+ 'USE_HEADERMAP' => 'NO',
+ 'ALWAYS_SEARCH_USER_PATHS' => 'NO',
+ }
+end