diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 17e650c2642..fab5343ce58 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -41,12 +41,24 @@ Pod::Spec.new do |s| s.header_dir = name src_dir = 'src/objective-c/ProtoRPC' - s.source_files = "#{src_dir}/*.{h,m}" - s.header_mappings_dir = "#{src_dir}" - s.dependency 'gRPC', version - s.dependency 'gRPC-RxLibrary', version - s.dependency 'Protobuf', '~> 3.0' + + s.subspec 'Main' do |ss| + ss.header_mappings_dir = "#{src_dir}" + ss.dependency 'gRPC', version + ss.dependency 'gRPC-RxLibrary', version + ss.dependency 'Protobuf', '~> 3.0' + + ss.source_files = "#{src_dir}/*.{h,m}" + end + s.subspec 'CFStream' do |ss| + ss.dependency 'gRPC/CFStream', version + ss.dependency "#{s.name}/Main", version + ss.pod_target_xcconfig = { + 'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1' + } + end + s.pod_target_xcconfig = { # This is needed by all pods that depend on Protobuf: 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1', diff --git a/gRPC.podspec b/gRPC.podspec index a55ab701f24..a1d77206281 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -63,8 +63,8 @@ Pod::Spec.new do |s| ss.dependency 'gRPC-Core', version end + # This subspec is mutually exclusive with the `Main` subspec s.subspec 'CFStream' do |ss| - ss.header_mappings_dir = "#{src_dir}" ss.dependency 'gRPC-Core/CFStream-Implementation', version ss.dependency "#{s.name}/Main", version diff --git a/templates/gRPC-ProtoRPC.podspec.template b/templates/gRPC-ProtoRPC.podspec.template index d2dcc429ef1..1e2cd19d77f 100644 --- a/templates/gRPC-ProtoRPC.podspec.template +++ b/templates/gRPC-ProtoRPC.podspec.template @@ -43,12 +43,24 @@ s.header_dir = name src_dir = 'src/objective-c/ProtoRPC' - s.source_files = "#{src_dir}/*.{h,m}" - s.header_mappings_dir = "#{src_dir}" - s.dependency 'gRPC', version - s.dependency 'gRPC-RxLibrary', version - s.dependency 'Protobuf', '~> 3.0' + + s.subspec 'Main' do |ss| + ss.header_mappings_dir = "#{src_dir}" + ss.dependency 'gRPC', version + ss.dependency 'gRPC-RxLibrary', version + ss.dependency 'Protobuf', '~> 3.0' + + ss.source_files = "#{src_dir}/*.{h,m}" + end + s.subspec 'CFStream' do |ss| + ss.dependency 'gRPC/CFStream', version + ss.dependency "#{s.name}/Main", version + ss.pod_target_xcconfig = { + 'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1' + } + end + s.pod_target_xcconfig = { # This is needed by all pods that depend on Protobuf: 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1', diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template index 9e417049167..a3190c2d8e6 100644 --- a/templates/gRPC.podspec.template +++ b/templates/gRPC.podspec.template @@ -65,8 +65,8 @@ ss.dependency 'gRPC-Core', version end + # This subspec is mutually exclusive with the `Main` subspec s.subspec 'CFStream' do |ss| - ss.header_mappings_dir = "#{src_dir}" ss.dependency 'gRPC-Core/CFStream-Implementation', version ss.dependency "#{s.name}/Main", version