-
Notifications
You must be signed in to change notification settings - Fork 6
RU-T50 Build fix #241
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
Merged
RU-T50 Build fix #241
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| const { withDangerousMod } = require('expo/config-plugins'); | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
|
|
||
| /** | ||
| * Config plugin that patches the Podfile to allow non-modular header includes | ||
| * inside the livekit_react_native_webrtc framework module. | ||
| * | ||
| * Fixes Xcode 26+ build error: | ||
| * include of non-modular header inside framework module | ||
| * 'livekit_react_native_webrtc.WebRTCModule' | ||
| * [-Werror,-Wnon-modular-include-in-framework-module] | ||
| */ | ||
| const withWebRTCFrameworkFix = (config) => { | ||
| return withDangerousMod(config, [ | ||
| 'ios', | ||
| async (config) => { | ||
| const podfilePath = path.join(config.modRequest.platformProjectRoot, 'Podfile'); | ||
| let contents = fs.readFileSync(podfilePath, 'utf-8'); | ||
|
|
||
| const marker = 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'; | ||
| if (contents.includes(marker)) { | ||
| return config; | ||
| } | ||
|
|
||
| const hook = ` | ||
| # Fix non-modular header includes in livekit-react-native-webrtc for Xcode 26+ | ||
| installer.pods_project.targets.each do |target| | ||
| if target.name == 'livekit_react_native_webrtc' | ||
| target.build_configurations.each do |config| | ||
| config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES' | ||
| end | ||
| end | ||
| end`; | ||
|
|
||
| // Insert after the react_native_post_install call, which is the last | ||
| // significant line inside the post_install block. | ||
| const anchor = 'react_native_post_install('; | ||
| const anchorIdx = contents.lastIndexOf(anchor); | ||
| if (anchorIdx === -1) { | ||
| throw new Error('[withWebRTCFrameworkFix] Could not find react_native_post_install in Podfile'); | ||
| } | ||
|
|
||
| // Find the closing `)` of the react_native_post_install call (may span multiple lines). | ||
| let depth = 0; | ||
| let insertAfter = anchorIdx; | ||
| for (let i = anchorIdx; i < contents.length; i++) { | ||
| if (contents[i] === '(') depth++; | ||
| if (contents[i] === ')') { | ||
| depth--; | ||
| if (depth === 0) { | ||
| insertAfter = i + 1; | ||
| break; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if (insertAfter === anchorIdx || depth !== 0) { | ||
| throw new Error( | ||
| '[withWebRTCFrameworkFix] Unclosed parenthesis in react_native_post_install call — ' + | ||
| 'could not locate closing ")". Aborting to avoid corrupting the Podfile.' | ||
| ); | ||
| } | ||
|
|
||
| contents = contents.slice(0, insertAfter) + hook + contents.slice(insertAfter); | ||
| fs.writeFileSync(podfilePath, contents); | ||
|
|
||
| return config; | ||
| }, | ||
| ]); | ||
| }; | ||
|
|
||
| module.exports = withWebRTCFrameworkFix; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.