Skip to content

Commit 855c8d8

Browse files
coadometa-codesync[bot]
authored andcommitted
Define RN_BUILDING for React Native's own CocoaPods targets
Summary: React Native's public C++ headers are gaining guards from `react/cxxstableapi`. Those guards turn a direct include of a fine-grained header into an error for consumers that opt into the strict API by defining `RN_STRICT_API`. React Native's own sources keep including those fine-grained headers directly, so they have to be exempt. The guards recognise the exemption via `RN_BUILDING`. Mark every first-party pod as part of React Native's own build by defining `RN_BUILDING` for it, through a new `mark_as_react_native_build` helper called last in each spec block Third-party pods deliberately do NOT get this: they compile their own code against the public API and must remain subject to the guards. For the same reason the definition goes into `pod_target_xcconfig`, which applies to the pod's own target, rather than `user_target_xcconfig`, which would leak it to the app. This change is inert on its own: nothing behaves differently unless a consumer defines `RN_STRICT_API`. Changelog: [Internal] Differential Revision: D115051089
1 parent 63c36fe commit 855c8d8

79 files changed

Lines changed: 219 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/react-native/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ Pod::Spec.new do |s|
3131
s.header_dir = "RCTActionSheet"
3232

3333
s.dependency "React-Core/RCTActionSheetHeaders", version
34+
35+
mark_as_react_native_build(s)
3436
end

packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,6 @@ Pod::Spec.new do |s|
8686
depend_on_js_engine(s)
8787
add_rn_third_party_dependencies(s)
8888
add_rncore_dependency(s)
89+
90+
mark_as_react_native_build(s)
8991
end

packages/react-native/Libraries/Blob/React-RCTBlob.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,6 @@ Pod::Spec.new do |s|
5656

5757
add_rn_third_party_dependencies(s)
5858
add_rncore_dependency(s)
59+
60+
mark_as_react_native_build(s)
5961
end

packages/react-native/Libraries/FBLazyVector/FBLazyVector.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ Pod::Spec.new do |s|
2828
s.source_files = podspec_sources("**/*.{c,h,m,mm,cpp}", "**/*.h")
2929
s.header_dir = "FBLazyVector"
3030

31+
mark_as_react_native_build(s)
3132
end

packages/react-native/Libraries/Image/React-RCTImage.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ Pod::Spec.new do |s|
5454

5555
add_rn_third_party_dependencies(s)
5656
add_rncore_dependency(s)
57+
58+
mark_as_react_native_build(s)
5759
end

packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,6 @@ Pod::Spec.new do |s|
4848
add_dependency(s, "React-RCTFBReactNativeSpec")
4949
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
5050
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
51+
52+
mark_as_react_native_build(s)
5153
end

packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ Pod::Spec.new do |s|
5252

5353
add_rn_third_party_dependencies(s)
5454
add_rncore_dependency(s)
55+
56+
mark_as_react_native_build(s)
5557
end

packages/react-native/Libraries/Network/React-RCTNetwork.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ Pod::Spec.new do |s|
5454

5555
add_rn_third_party_dependencies(s)
5656
add_rncore_dependency(s)
57+
58+
mark_as_react_native_build(s)
5759
end

packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,6 @@ Pod::Spec.new do |s|
5050
add_dependency(s, "React-NativeModulesApple")
5151

5252
add_rncore_dependency(s)
53+
54+
mark_as_react_native_build(s)
5355
end

packages/react-native/Libraries/Required/RCTRequired.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ Pod::Spec.new do |s|
2727
s.source = source
2828
s.source_files = podspec_sources("**/*.{c,h,m,mm,cpp}", "**/*.h")
2929
s.header_dir = "RCTRequired"
30+
31+
mark_as_react_native_build(s)
3032
end

0 commit comments

Comments
 (0)