[ios][precompile] add support for clang virtual file system
Summary:
To solve our problem with header files from the React.XCFramework not being consumable due to the legacy Cocoapods headers, we used to point all header search / resolving into the Pods/Headers folder when building even with the framework installed.
This is a problem since an xcframework expects a modular header structure that can be consumed from within the headers folder of the framework.
The headers are used for both Objective-c compiling and for creating clang modules that can be consumed by Swift in our setup.
This commit fixes the above issues and makes a modular clang virtual file system from the header files we distribute. This vfs-overlay file will then be used by the rncore.rb script when installing the 'React-Core-prebuilt' pod and map the header files requested in the source code to the actual location on disk where the React.xcframework headers are installed.
Here are the changes:
- Added vfs.js with types for creating clang virtual file system overlays
- Added resolving the paths in the vfs file to the actual install path
- Added installing the vfs overlay with the switch
-ivfsoverlay <path>to compiler settings for both obj-c and swift on pod installation - Add vfs targets to the app target on post install
Prev PR: https://github.com/facebook/react-native/pull/54841
Changelog:
[IOS] [FIXED] - added support for clang virtual file system in React.XCFramework
Test Plan:
Run RNTester with prebuilt
Job Summary for Gradle
Test All :: run_fantom_tests
| Gradle Root Project | Requested Tasks | Gradle Version | Build Outcome | Build Scan® |
|---|---|---|---|---|
| react-native-github | :private:react-native-fantom:buildFantomTester | 9.0.0 | :x: |
Job Summary for Gradle
Test All :: run_fantom_tests
| Gradle Root Project | Requested Tasks | Gradle Version | Build Outcome | Build Scan® |
|---|---|---|---|---|
| react-native-github | :private:react-native-fantom:buildFantomTester | 9.0.0 | :x: |
Job Summary for Gradle
Test All :: run_fantom_tests
| Gradle Root Project | Requested Tasks | Gradle Version | Build Outcome | Build Scan® |
|---|---|---|---|---|
| react-native-github | :private:react-native-fantom:buildFantomTester | 9.0.0 | :x: |