1 source 'https://github.com/CocoaPods/Specs.git'
4 install! 'cocoapods', :deterministic_uuids => false
6 # Location of gRPC's repo root relative to this file.
7 GRPC_LOCAL_SRC = '../../../../..'
9 # Install the dependencies in the main target plus all test targets.
10 target 'CFStreamTests' do
11 pod 'gRPC-Core', :path => GRPC_LOCAL_SRC
12 pod 'BoringSSL-GRPC', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true
15 pre_install do |installer|
16 # This is the gRPC-Core podspec object, as initialized by its podspec file.
17 grpc_core_spec = installer.pod_targets.find{|t| t.name == 'gRPC-Core'}.root_spec
19 # Copied from gRPC-Core.podspec, except for the adjusted src_root:
20 src_root = "$(PODS_ROOT)/../#{GRPC_LOCAL_SRC}"
21 grpc_core_spec.pod_target_xcconfig = {
22 'GRPC_SRC_ROOT' => src_root,
23 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
24 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
25 # If we don't set these two settings, `include/grpc/support/time.h` and
26 # `src/core/lib/gpr/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
28 'USE_HEADERMAP' => 'NO',
29 'ALWAYS_SEARCH_USER_PATHS' => 'NO',
33 post_install do |installer|
34 installer.pods_project.targets.each do |target|
35 target.build_configurations.each do |config|
36 config.build_settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = 'YES'
39 # CocoaPods creates duplicated library targets of gRPC-Core when the test targets include
40 # non-default subspecs of gRPC-Core. All of these library targets start with prefix 'gRPC-Core'
41 # and require the same error suppresion.
42 if target.name.start_with?('gRPC-Core')
43 target.build_configurations.each do |config|
44 # TODO(zyc): Remove this setting after the issue is resolved
45 # GPR_UNREACHABLE_CODE causes "Control may reach end of non-void
47 config.build_settings['GCC_WARN_ABOUT_RETURN_TYPE'] = 'NO'