add support for USE_FRAMEWORKS when using prebuilt React Native Core (#52489)

Summary:
When using prebuilts the USE_FRAMEWORKS setting is not really relevant for the React Native code, since there will not be any source code to build frameworks for - and because we already have a framework for the code in React.XCFramework.

This commit adds a new command to the React Native podspecs like we did with the ReactNativeDependencies framework. The method is called `add_rncore_dependency` and it does nothing when building from source - but when linking with the React.XCFramework it explicitly adds linking with the framework.

In addition there are a few places in the ruby code where we check for the USE_FRAMEWORK value and changes some settings - where needed this commit will add a separate check to ensure we're building from source when making these changes.

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - Added support for using USE_FRAMEWORKS with prebuilt React Native Core

Pull Request resolved: https://github.com/facebook/react-native/pull/52489

Test Plan:
RNTester:

- Builds without USE_FRAMEWORKS as before with/without prebuilt
- Builds with USE_FRAMEWORKS=dynamic as before with source - and now also with prebuilt code.
- Same goes for the static variant.

Reviewed By: mdvacca

Differential Revision: D78012332

Pulled By: cipolleschi

fbshipit-source-id: ea942738ae52b9dceae48fb78a5026f04b7545b8
This commit is contained in:
Christian Falch
2025-07-14 11:45:03 +01:00
committed by Moti Zilberman
parent bbb322b4f4
commit c9263e71e1
55 changed files with 101 additions and 34 deletions
@@ -41,4 +41,5 @@ Pod::Spec.new do |s|
s.dependency "React-jsi", version
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end