-
Notifications
You must be signed in to change notification settings - Fork 24.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ios][prebuild] fixed inclusion of resources in swift package #50050
[ios][prebuild] fixed inclusion of resources in swift package #50050
Conversation
We had some issues with the Swift package build step where we saw an error message when we included resources and couldn't find out why this was happening. After systematically going through the generated swift package file and looking for a reason I found a mistake. When we generate the Package.swift file we pass all compilerFlags from the configuration of the target to both cpp/c flags - which in the case of the folly target ends up being passed to the dependency scanner which isn't too happy about this c++ flag. The solution is to break out the c++ stdlib version as a separate setting in the configuration and pass it only to the `cxxSettings` section in our final Package.swift file. This commit fixes this by: - Adding a new field in the dependency settings struct called `cppVersion` - Updated configuration with correct resources and cppVersion for relevant targets - Now emits the correct cppVersion to the cxxSettings section - Fixed issue with the copy bundles step that didn't copy the directory in some cases.
Instead of passing the compilerFlags settings to both c and cxx these are now split in two so that it is easy to provide different flags to the cxx compiler (setting the correcct std-lib version f.ex).
- Added c++ standard to all targets - Removed -Wno-everything from all targets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for applying all the feedback!
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@cipolleschi merged this pull request in 9cf1383. |
This pull request was successfully merged by @chrfalch in 9cf1383 When will my fix make it into a release? | How to file a pick request? |
Summary:
We had some issues with the Swift package build step where we saw an error message when we included resources and couldn't find out why this was happening.
After systematically going through the generated swift package file and looking for a reason I found a mistake.
When we generate the Package.swift file we pass all compilerFlags from the configuration of the target to both cpp/c flags - which in the case of the folly target ends up being passed to the dependency scanner which isn't too happy about this c++ flag.
The solution was to split
compilerFlags
intocCompilerFlags
andcxxCompilerFlags
.This commit fixes this by:
compilerFlags
intocCompilerFlags
andcxxCompilerFlags
.Changelog:
[INTERNAL] - Fixed processing resources in the generated swift package for the RN Dependencies/prebuild
Test-plan
Test by prebuilding RNDependencies, include the XCFramework in a new app and try to load resource bundles: