Commit 698e1016 authored by sjindel-google's avatar sjindel-google Committed by Vyacheslav Egorov

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

Fixes #18829
parent ca0e144f
...@@ -391,6 +391,7 @@ class AOTSnapshotter { ...@@ -391,6 +391,7 @@ class AOTSnapshotter {
aot: true, aot: true,
entryPointsJsonFiles: entryPointsJsonFiles, entryPointsJsonFiles: entryPointsJsonFiles,
trackWidgetCreation: false, trackWidgetCreation: false,
targetProductVm: buildMode == BuildMode.release,
); );
// Write path to frontend_server, since things need to be re-generated when that changes. // Write path to frontend_server, since things need to be re-generated when that changes.
......
...@@ -84,6 +84,7 @@ class KernelCompiler { ...@@ -84,6 +84,7 @@ class KernelCompiler {
String packagesPath, String packagesPath,
List<String> fileSystemRoots, List<String> fileSystemRoots,
String fileSystemScheme, String fileSystemScheme,
bool targetProductVm = false,
}) async { }) async {
final String frontendServer = artifacts.getArtifactPath( final String frontendServer = artifacts.getArtifactPath(
Artifact.frontendServerSnapshotForEngineDartSdk Artifact.frontendServerSnapshotForEngineDartSdk
...@@ -134,6 +135,9 @@ class KernelCompiler { ...@@ -134,6 +135,9 @@ class KernelCompiler {
command.add('--aot'); command.add('--aot');
command.add('--tfa'); command.add('--tfa');
} }
if (targetProductVm) {
command.add('-Ddart.vm.product=true');
}
if (entryPointsJsonFiles != null) { if (entryPointsJsonFiles != null) {
for (String entryPointsJson in entryPointsJsonFiles) { for (String entryPointsJson in entryPointsJsonFiles) {
command.addAll(<String>['--entry-points', entryPointsJson]); command.addAll(<String>['--entry-points', entryPointsJson]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment