[flutter_tools] fix missing cmake (#103761)
This commit is contained in:
committed by
GitHub
parent
90a592bf36
commit
0ad0dc255d
@@ -124,34 +124,33 @@ Future<void> _runCmake(String buildModeName, Directory sourceDir, Directory buil
|
||||
final bool needCrossBuildOptionsForArm64 = needCrossBuild
|
||||
&& targetPlatform == TargetPlatform.linux_arm64;
|
||||
int result;
|
||||
try {
|
||||
result = await globals.processUtils.stream(
|
||||
<String>[
|
||||
'cmake',
|
||||
'-G',
|
||||
'Ninja',
|
||||
'-DCMAKE_BUILD_TYPE=$buildFlag',
|
||||
'-DFLUTTER_TARGET_PLATFORM=${getNameForTargetPlatform(targetPlatform)}',
|
||||
// Support cross-building for arm64 targets on x64 hosts.
|
||||
// (Cross-building for x64 on arm64 hosts isn't supported now.)
|
||||
if (needCrossBuild)
|
||||
'-DFLUTTER_TARGET_PLATFORM_SYSROOT=$targetSysroot',
|
||||
if (needCrossBuildOptionsForArm64)
|
||||
'-DCMAKE_C_COMPILER_TARGET=aarch64-linux-gnu',
|
||||
if (needCrossBuildOptionsForArm64)
|
||||
'-DCMAKE_CXX_COMPILER_TARGET=aarch64-linux-gnu',
|
||||
sourceDir.path,
|
||||
],
|
||||
workingDirectory: buildDir.path,
|
||||
environment: <String, String>{
|
||||
'CC': 'clang',
|
||||
'CXX': 'clang++',
|
||||
},
|
||||
trace: true,
|
||||
);
|
||||
} on ArgumentError {
|
||||
throwToolExit("cmake not found. Run 'flutter doctor' for more information.");
|
||||
if (!globals.processManager.canRun('cmake')) {
|
||||
throwToolExit(globals.userMessages.cmakeMissing);
|
||||
}
|
||||
result = await globals.processUtils.stream(
|
||||
<String>[
|
||||
'cmake',
|
||||
'-G',
|
||||
'Ninja',
|
||||
'-DCMAKE_BUILD_TYPE=$buildFlag',
|
||||
'-DFLUTTER_TARGET_PLATFORM=${getNameForTargetPlatform(targetPlatform)}',
|
||||
// Support cross-building for arm64 targets on x64 hosts.
|
||||
// (Cross-building for x64 on arm64 hosts isn't supported now.)
|
||||
if (needCrossBuild)
|
||||
'-DFLUTTER_TARGET_PLATFORM_SYSROOT=$targetSysroot',
|
||||
if (needCrossBuildOptionsForArm64)
|
||||
'-DCMAKE_C_COMPILER_TARGET=aarch64-linux-gnu',
|
||||
if (needCrossBuildOptionsForArm64)
|
||||
'-DCMAKE_CXX_COMPILER_TARGET=aarch64-linux-gnu',
|
||||
sourceDir.path,
|
||||
],
|
||||
workingDirectory: buildDir.path,
|
||||
environment: <String, String>{
|
||||
'CC': 'clang',
|
||||
'CXX': 'clang++',
|
||||
},
|
||||
trace: true,
|
||||
);
|
||||
if (result != 0) {
|
||||
throwToolExit('Unable to generate build files');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user