Skip to content

Commit e4704d3

Browse files
committed
“Allow non-modular includes in framework modules”
It’s the magic sentence that allows pods dependent on RxLibrary to be archived correctly by XCode. It’s less than ideal, and seems arbitrary (why RxLibrary specifically?), so we’ll try to produce a minimal case and open an issue with it in the Cocoapods repo.
1 parent 9b45afb commit e4704d3

File tree

8 files changed

+50
-25
lines changed

8 files changed

+50
-25
lines changed

examples/objective-c/auth_sample/AuthTestService.podspec

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ Pod::Spec.new do |s|
4545
ms.requires_arc = false
4646
# The generated files depend on the protobuf runtime.
4747
ms.dependency "Protobuf"
48-
# This is needed by all pods that depend on Protobuf:
49-
ms.pod_target_xcconfig = {
50-
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
51-
}
5248
end
5349

5450
# Files generated by the gRPC plugin
@@ -60,4 +56,11 @@ Pod::Spec.new do |s|
6056
ss.dependency "gRPC-ProtoRPC"
6157
ss.dependency "#{s.name}/Messages"
6258
end
59+
60+
s.pod_target_xcconfig = {
61+
# This is needed by all pods that depend on Protobuf:
62+
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
63+
# This is needed by all pods that depend on gRPC-RxLibrary:
64+
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
65+
}
6366
end

examples/objective-c/helloworld/HelloWorld.podspec

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ Pod::Spec.new do |s|
4545
ms.requires_arc = false
4646
# The generated files depend on the protobuf runtime.
4747
ms.dependency "Protobuf"
48-
# This is needed by all pods that depend on Protobuf:
49-
ms.pod_target_xcconfig = {
50-
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
51-
}
5248
end
5349

5450
# Files generated by the gRPC plugin
@@ -60,4 +56,11 @@ Pod::Spec.new do |s|
6056
ss.dependency "gRPC-ProtoRPC"
6157
ss.dependency "#{s.name}/Messages"
6258
end
59+
60+
s.pod_target_xcconfig = {
61+
# This is needed by all pods that depend on Protobuf:
62+
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
63+
# This is needed by all pods that depend on gRPC-RxLibrary:
64+
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
65+
}
6366
end

examples/objective-c/route_guide/RouteGuide.podspec

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ Pod::Spec.new do |s|
4545
ms.requires_arc = false
4646
# The generated files depend on the protobuf runtime.
4747
ms.dependency "Protobuf"
48-
# This is needed by all pods that depend on Protobuf:
49-
ms.pod_target_xcconfig = {
50-
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
51-
}
5248
end
5349

5450
# Files generated by the gRPC plugin
@@ -60,4 +56,11 @@ Pod::Spec.new do |s|
6056
ss.dependency "gRPC-ProtoRPC"
6157
ss.dependency "#{s.name}/Messages"
6258
end
59+
60+
s.pod_target_xcconfig = {
61+
# This is needed by all pods that depend on Protobuf:
62+
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
63+
# This is needed by all pods that depend on gRPC-RxLibrary:
64+
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
65+
}
6366
end

gRPC-ProtoRPC.podspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ Pod::Spec.new do |s|
6262
s.dependency 'gRPC', version
6363
s.dependency 'gRPC-RxLibrary', version
6464
s.dependency 'Protobuf', '~> 3.0.0-beta-3.1'
65-
# This is needed by all pods that depend on Protobuf:
6665
s.pod_target_xcconfig = {
66+
# This is needed by all pods that depend on Protobuf:
6767
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
68+
# This is needed by all pods that depend on gRPC-RxLibrary:
69+
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
6870
}
6971
end

gRPC.podspec

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,9 @@ Pod::Spec.new do |s|
6565

6666
# Certificates, to be able to establish TLS connections:
6767
s.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] }
68+
69+
s.pod_target_xcconfig = {
70+
# This is needed by all pods that depend on gRPC-RxLibrary:
71+
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
72+
}
6873
end

src/objective-c/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ Pod::Spec.new do |s|
8282
ms.requires_arc = false
8383
# The generated files depend on the protobuf runtime.
8484
ms.dependency 'Protobuf'
85-
# This is needed by all pods that depend on Protobuf:
86-
ms.pod_target_xcconfig = {
87-
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
88-
}
8985
end
9086

9187
# The --objcgrpc_out plugin generates a pair of .pbrpc.h/.pbrpc.m files for each .proto file with
@@ -98,6 +94,13 @@ Pod::Spec.new do |s|
9894
ss.dependency 'gRPC-ProtoRPC'
9995
ss.dependency "#{s.name}/Messages"
10096
end
97+
98+
s.pod_target_xcconfig = {
99+
# This is needed by all pods that depend on Protobuf:
100+
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
101+
# This is needed by all pods that depend on gRPC-RxLibrary:
102+
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
103+
}
101104
end
102105
```
103106

src/objective-c/examples/RemoteTestClient/RemoteTest.podspec

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ Pod::Spec.new do |s|
3535
ms.header_mappings_dir = '.'
3636
ms.requires_arc = false
3737
ms.dependency 'Protobuf'
38-
# This is needed by all pods that depend on Protobuf:
39-
ms.pod_target_xcconfig = {
40-
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
41-
}
4238
end
4339

4440
s.subspec 'Services' do |ss|
@@ -48,4 +44,11 @@ Pod::Spec.new do |s|
4844
ss.dependency 'gRPC-ProtoRPC'
4945
ss.dependency "#{s.name}/Messages"
5046
end
47+
48+
s.pod_target_xcconfig = {
49+
# This is needed by all pods that depend on Protobuf:
50+
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
51+
# This is needed by all pods that depend on gRPC-RxLibrary:
52+
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
53+
}
5154
end

src/objective-c/tests/RemoteTestClient/RemoteTest.podspec

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ Pod::Spec.new do |s|
3535
ms.header_mappings_dir = "."
3636
ms.requires_arc = false
3737
ms.dependency "Protobuf"
38-
# This is needed by all pods that depend on Protobuf:
39-
ms.pod_target_xcconfig = {
40-
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
41-
}
4238
end
4339

4440
s.subspec "Services" do |ss|
@@ -48,4 +44,11 @@ Pod::Spec.new do |s|
4844
ss.dependency "gRPC-ProtoRPC"
4945
ss.dependency "#{s.name}/Messages"
5046
end
47+
48+
s.pod_target_xcconfig = {
49+
# This is needed by all pods that depend on Protobuf:
50+
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
51+
# This is needed by all pods that depend on gRPC-RxLibrary:
52+
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
53+
}
5154
end

0 commit comments

Comments
 (0)