Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
0ad0dc25
Unverified
Commit
0ad0dc25
authored
May 14, 2022
by
Christopher Fujino
Committed by
GitHub
May 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] fix missing cmake (#103761)
parent
90a592bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
34 deletions
+30
-34
build_linux.dart
packages/flutter_tools/lib/src/linux/build_linux.dart
+26
-27
build_linux_test.dart
..._tools/test/commands.shard/hermetic/build_linux_test.dart
+4
-7
No files found.
packages/flutter_tools/lib/src/linux/build_linux.dart
View file @
0ad0dc25
...
...
@@ -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'
);
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_linux_test.dart
View file @
0ad0dc25
...
...
@@ -172,18 +172,15 @@ void main() {
OperatingSystemUtils:
()
=>
FakeOperatingSystemUtils
(),
});
testUsingContext
(
'Handles
argument error from
missing cmake'
,
()
async
{
testUsingContext
(
'Handles missing cmake'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
setUpMockProjectFilesForBuild
();
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
cmakeCommand
(
'release'
,
onRun:
()
{
throw
ArgumentError
();
}),
]);
processManager
=
FakeProcessManager
.
empty
()
..
excludedExecutables
.
add
(
'cmake'
);
expect
(
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'linux'
,
'--no-pub'
]
),
throwsToolExit
(
message:
"cmake not found. Run 'flutter doctor' for more information."
));
),
throwsToolExit
(
message:
'CMake is required for Linux development.'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment