Skip to content

Commit 1eab3f4

Browse files
committed
fix: apply CMake 3.31.6 only on Windows for EAS builds
1 parent f972720 commit 1eab3f4

3 files changed

Lines changed: 30 additions & 9 deletions

File tree

hydraflow-app/app.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const appJson = require('./app.json');
2+
3+
const WINDOWS_CMAKE_PLUGIN = './plugins/withWindowsCmakeObjectPath';
4+
5+
/** @returns {import('expo/config').ExpoConfig} */
6+
module.exports = () => {
7+
const expo = { ...appJson.expo, plugins: [...appJson.expo.plugins] };
8+
9+
// CMake 3.31.6 + short object paths are only needed for local Windows native builds.
10+
// EAS/Linux agents do not ship that CMake version ([CXX1300] if forced globally).
11+
if (process.platform === 'win32') {
12+
expo.plugins.push(
13+
[
14+
'expo-build-properties',
15+
{
16+
android: {
17+
cmakeVersion: '3.31.6',
18+
},
19+
},
20+
],
21+
WINDOWS_CMAKE_PLUGIN,
22+
);
23+
}
24+
25+
return { expo };
26+
};

hydraflow-app/app.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,6 @@
5252
"enforceContrast": true
5353
}
5454
],
55-
[
56-
"expo-build-properties",
57-
{
58-
"android": {
59-
"cmakeVersion": "3.31.6"
60-
}
61-
}
62-
],
63-
"./plugins/withWindowsCmakeObjectPath",
6455
"@react-native-google-signin/google-signin",
6556
"expo-asset"
6657
],

hydraflow-app/plugins/withWindowsCmakeObjectPath.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ const { withAppBuildGradle } = require('expo/config-plugins');
55
* Complements android.cmakeVersion=3.31.6 (Ninja 1.12+) from expo-build-properties.
66
*/
77
function withWindowsCmakeObjectPath(config) {
8+
if (process.platform !== 'win32') {
9+
return config;
10+
}
11+
812
return withAppBuildGradle(config, (config) => {
913
if (config.modResults.language !== 'groovy') {
1014
return config;

0 commit comments

Comments
 (0)