Skip to content
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

Set build settings required for Swift in the template project #2067

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

tsapeta
Copy link

@tsapeta tsapeta commented Feb 5, 2024

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary:

As of Expo SDK50 it's possible to use Expo modules in react-native-macos projects. During pod install and a build phase script, expo-modules-autolinking generates a Swift file called ExpoModulesProvider.swift and adds it programmatically to the pbxproj using CocoaPods tooling.
The problem is that the template project doesn't have SWIFT_VERSION build setting, which causes the below error when building:

Value for SWIFT_VERSION cannot be empty.

If we manually add a Swift file through Xcode, it automatically adds SWIFT_VERSION, SWIFT_OPTIMIZATION_LEVEL and CLANG_ENABLE_MODULES build settings to the target. These settings are already present in the target for iOS.

To made these changes, I simply manually added a dummy Swift file to the HelloWorld project and let Xcode update these settings.

Changelog:

[IOS] [CHANGED] - Set build settings required for Swift in the template project

Test Plan:

The newly generated project builds as expected (i.e. without the issue mentioned above) after applying this change and integrating it with Expo modules.

@tsapeta tsapeta marked this pull request as ready for review February 5, 2024 20:28
@tsapeta tsapeta requested a review from a team as a code owner February 5, 2024 20:28
Copy link
Collaborator

@Saadnajmi Saadnajmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want this on 0.73, do you mind making an equivalent PR on that branch? It's easier to approve and merge that way.

@Saadnajmi Saadnajmi merged commit aefe811 into microsoft:main Feb 5, 2024
14 checks passed
@tsapeta tsapeta deleted the @tsapeta/set-swift-version branch February 6, 2024 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants