Skip to content

Commit 5c9dc39

Browse files
authored
Merge pull request #95 from giolaq/fix/issue-93-ios-prebuild-swift-appdelegate
2 parents a58a047 + 0891298 commit 5c9dc39

3 files changed

Lines changed: 42 additions & 1 deletion

File tree

apps/expo-multi-tv/app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"useExoplayerDash": false
4848
}
4949
}
50-
]
50+
],
51+
"./plugins/withFmtXcode26Fix"
5152
],
5253
"name": "MultiTVSample",
5354
"slug": "MultiTVSample",
1.39 KB
Loading
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const { withDangerousMod } = require("expo/config-plugins");
2+
const fs = require("fs");
3+
const path = require("path");
4+
5+
function withFmtXcode26Fix(config) {
6+
return withDangerousMod(config, [
7+
"ios",
8+
(config) => {
9+
const podfilePath = path.join(
10+
config.modRequest.platformProjectRoot,
11+
"Podfile"
12+
);
13+
let podfile = fs.readFileSync(podfilePath, "utf8");
14+
15+
if (podfile.includes("CLANG_CXX_LANGUAGE_STANDARD") && podfile.includes("fmt")) {
16+
return config;
17+
}
18+
19+
const fmtFix = `
20+
# Fix fmt consteval errors on Xcode 26+ by compiling fmt with C++17
21+
installer.pods_project.targets.each do |target|
22+
if target.name == 'fmt'
23+
target.build_configurations.each do |bc|
24+
bc.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'
25+
end
26+
end
27+
end`;
28+
29+
podfile = podfile.replace(
30+
/post_install do \|installer\|/,
31+
`post_install do |installer|${fmtFix}`
32+
);
33+
34+
fs.writeFileSync(podfilePath, podfile, "utf8");
35+
return config;
36+
},
37+
]);
38+
}
39+
40+
module.exports = withFmtXcode26Fix;

0 commit comments

Comments
 (0)