Fix CMake invocation for 3.10 compat (#57415)

The -S/-B format of specifying source and build directories wasn't added
until 3.13. For 3.10 compatibility, use the older form of having the
working directory as the build directory, and the last argument as the
source directory.

Fixes #57409
This commit is contained in:
stuartmorgan
2020-05-18 09:25:28 -07:00
committed by GitHub
parent b19b744bb7
commit f991308e3e
2 changed files with 53 additions and 44 deletions

View File

@@ -81,20 +81,20 @@ Future<void> buildLinux(
Future<void> _runCmake(String buildModeName, Directory sourceDir, Directory buildDir) async {
final Stopwatch sw = Stopwatch()..start();
await buildDir.create(recursive: true);
final String buildFlag = toTitleCase(buildModeName);
int result;
try {
result = await processUtils.stream(
<String>[
'cmake',
'-S',
sourceDir.path,
'-B',
buildDir.path,
'-G',
'Ninja',
'-DCMAKE_BUILD_TYPE=$buildFlag',
sourceDir.path,
],
workingDirectory: buildDir.path,
environment: <String, String>{
'CC': 'clang',
'CXX': 'clang++'