Skip to content

Commit 93284f5

Browse files
coadometa-codesync[bot]
authored andcommitted
Define RN_BUILDING for React Native's own CocoaPods targets (#57858)
Summary: Pull Request resolved: #57858 `RN_BUILDING` marks React Native's own targets so the react/cxxstableapi guards stay inert for internal sources, which keep including fine-grained headers directly. It is required whenever `RN_STRICT_API` reaches React Native's own compilation rather than only the consumer's: - Project-wide enablement — a consumer applying the flag to every pod target (the CocoaPods post_install idiom) or through a global Buck config. Without RN_BUILDING, React Native's own translation units fail against their own guards. - Private headers — `PrivateGuard.h` has no umbrella escape (#if defined(RN_STRICT_API) && !defined(RN_BUILDING)), so RN_BUILDING is the only way internal code can include them at all. 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 This change is inert on its own: nothing behaves differently unless a consumer defines `RN_STRICT_API`. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D115051089 fbshipit-source-id: f1178e2d0727827e5f40fc7b4a8f55b4d9b505cc
1 parent d3daf11 commit 93284f5

79 files changed

Lines changed: 221 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
@@ -87,4 +87,6 @@ Pod::Spec.new do |s|
8787
depend_on_js_engine(s)
8888
add_rn_third_party_dependencies(s)
8989
add_rncore_dependency(s)
90+
91+
mark_as_react_native_build(s)
9092
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)