xref: /aosp_15_r20/external/grpc-grpc/test/cpp/cocoapods/Podfile (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1source 'https://github.com/CocoaPods/Specs.git'
2platform :ios, '10.0'
3
4install! 'cocoapods', :deterministic_uuids => false
5
6# Location of gRPC's repo root relative to this file.
7GRPC_LOCAL_SRC = '../../..'
8
9%w(
10  test
11  generic
12).each do |target_name|
13  target target_name do
14    pod 'gRPC-Core',      :path => GRPC_LOCAL_SRC
15    pod 'gRPC-C++',       :path => GRPC_LOCAL_SRC
16    pod 'BoringSSL-GRPC',      :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true
17  end
18end
19
20post_install do |installer|
21  installer.pods_project.targets.each do |target|
22    target.build_configurations.each do |config|
23      config.build_settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = 'YES'
24    end
25
26    # CocoaPods creates duplicated library targets of gRPC-Core when the test targets include
27    # non-default subspecs of gRPC-Core. All of these library targets start with prefix 'gRPC-Core'
28    # and require the same error suppresion.
29    if target.name.start_with?('gRPC-Core')
30      target.build_configurations.each do |config|
31        # TODO(zyc): Remove this setting after the issue is resolved
32        # GPR_UNREACHABLE_CODE causes "Control may reach end of non-void
33        # function" warning
34        config.build_settings['GCC_WARN_ABOUT_RETURN_TYPE'] = 'NO'
35        # Abseil isn't free from the following warning
36        config.build_settings['GCC_WARN_64_TO_32_BIT_CONVERSION'] = 'NO'
37        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_CRONET_WITH_PACKET_COALESCING=1'
38      end
39    end
40  end
41end
42