[build] Decide in one place between using app-jit and kernel for the SDK snapshots.

Change-Id: Id642c635979b96f09780aba49ffcb1b9f215878d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306666
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak 2023-06-01 15:20:58 +00:00 committed by Commit Queue
parent 87362c6f42
commit 52791b4e0d
4 changed files with 7 additions and 14 deletions

View file

@ -28,7 +28,7 @@ declare_args() {
dart_runtime_mode = "develop"
# Explicitly set the target architecture to use a simulator.
# Available options are: arm, arm64, x64, ia32.
# Available options are: arm, arm64, x64, ia32, riscv32, riscv64.
dart_target_arch = target_cpu
# The optimization level to use for debug builds. Defaults to 0 for builds with
@ -85,13 +85,6 @@ declare_args() {
}
declare_args() {
# We create a kernel service app-jit snapshot only for when the target
# architecture is x64 for other cases we will use the '.dill' file
# which is already linked in the VM.
create_kernel_service_snapshot =
dart_target_arch == "x64" ||
(dart_target_arch == "arm64" && target_os == "mac")
# The analyze_snapshot tool is only supported on 64 bit AOT builds that use
# ELF.
build_analyze_snapshot =

View file

@ -15,8 +15,8 @@
import("../build/dart/copy_tree.gni")
import("../build/executable_suffix.gni")
import("../runtime/runtime_args.gni")
import("../sdk_args.gni")
import("../utils/application_snapshot.gni")
declare_args() {
# Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries.
@ -120,7 +120,7 @@ _platform_sdk_snapshots = [
"../utils/kernel-service:frontend_server",
],
]
if (create_kernel_service_snapshot) {
if (dart_snapshot_kind == "app-jit") {
_platform_sdk_snapshots += [ [
"kernel-service",
"../utils/kernel-service:kernel-service_snapshot",

View file

@ -11,10 +11,10 @@ _dart_root = get_path_info("..", "abspath")
declare_args() {
# Default to building app-jit snapshots. The simulator and cross builds
# override this to script snapshots to cut down on build time.
if (target_cpu != host_cpu) {
dart_snapshot_kind = "kernel"
} else {
if (dart_target_arch == target_cpu && target_cpu == host_cpu) {
dart_snapshot_kind = "app-jit"
} else {
dart_snapshot_kind = "kernel"
}
}

View file

@ -9,7 +9,7 @@ import("../application_snapshot.gni")
import("../create_timestamp.gni")
group("kernel-service") {
if (create_kernel_service_snapshot) {
if (dart_snapshot_kind == "app-jit") {
deps = [ ":copy_kernel-service_snapshot" ]
} else {
deps = [ ":kernel_service_dill" ]