Let the Kernel FE know whether it's building for a release VM. (#18876)

Fixes #18829
This commit is contained in:
sjindel-google 2018-06-29 17:01:34 +02:00 committed by Vyacheslav Egorov
parent ca0e144f9f
commit 698e1016bb
2 changed files with 5 additions and 0 deletions

View File

@ -391,6 +391,7 @@ class AOTSnapshotter {
aot: true,
entryPointsJsonFiles: entryPointsJsonFiles,
trackWidgetCreation: false,
targetProductVm: buildMode == BuildMode.release,
);
// Write path to frontend_server, since things need to be re-generated when that changes.

View File

@ -84,6 +84,7 @@ class KernelCompiler {
String packagesPath,
List<String> fileSystemRoots,
String fileSystemScheme,
bool targetProductVm = false,
}) async {
final String frontendServer = artifacts.getArtifactPath(
Artifact.frontendServerSnapshotForEngineDartSdk
@ -134,6 +135,9 @@ class KernelCompiler {
command.add('--aot');
command.add('--tfa');
}
if (targetProductVm) {
command.add('-Ddart.vm.product=true');
}
if (entryPointsJsonFiles != null) {
for (String entryPointsJson in entryPointsJsonFiles) {
command.addAll(<String>['--entry-points', entryPointsJson]);