diff --git a/apps/expo-multi-tv/app.json b/apps/expo-multi-tv/app.json index 3200b08..9de83a0 100644 --- a/apps/expo-multi-tv/app.json +++ b/apps/expo-multi-tv/app.json @@ -47,7 +47,8 @@ "useExoplayerDash": false } } - ] + ], + "./plugins/withFmtXcode26Fix" ], "name": "MultiTVSample", "slug": "MultiTVSample", diff --git a/apps/expo-multi-tv/assets/tv_icons/icon-400x240.png b/apps/expo-multi-tv/assets/tv_icons/icon-400x240.png index 17226ab..560a8f2 100644 Binary files a/apps/expo-multi-tv/assets/tv_icons/icon-400x240.png and b/apps/expo-multi-tv/assets/tv_icons/icon-400x240.png differ diff --git a/apps/expo-multi-tv/plugins/withFmtXcode26Fix.js b/apps/expo-multi-tv/plugins/withFmtXcode26Fix.js new file mode 100644 index 0000000..d5f90d4 --- /dev/null +++ b/apps/expo-multi-tv/plugins/withFmtXcode26Fix.js @@ -0,0 +1,40 @@ +const { withDangerousMod } = require("expo/config-plugins"); +const fs = require("fs"); +const path = require("path"); + +function withFmtXcode26Fix(config) { + return withDangerousMod(config, [ + "ios", + (config) => { + const podfilePath = path.join( + config.modRequest.platformProjectRoot, + "Podfile" + ); + let podfile = fs.readFileSync(podfilePath, "utf8"); + + if (podfile.includes("CLANG_CXX_LANGUAGE_STANDARD") && podfile.includes("fmt")) { + return config; + } + + const fmtFix = ` + # Fix fmt consteval errors on Xcode 26+ by compiling fmt with C++17 + installer.pods_project.targets.each do |target| + if target.name == 'fmt' + target.build_configurations.each do |bc| + bc.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17' + end + end + end`; + + podfile = podfile.replace( + /post_install do \|installer\|/, + `post_install do |installer|${fmtFix}` + ); + + fs.writeFileSync(podfilePath, podfile, "utf8"); + return config; + }, + ]); +} + +module.exports = withFmtXcode26Fix;