Move libdart selection into its own target in //flutter/runtime. (flutter/engine#8373)

Cleanup repeated rules.
This commit is contained in:
Chinmay Garde
2019-03-29 14:29:09 -07:00
committed by GitHub
parent 445287d84a
commit 9a54dbc65a
5 changed files with 20 additions and 30 deletions

View File

@@ -4,6 +4,7 @@
import("//build/compiled_action.gni")
import("//third_party/dart/utils/compile_platform.gni")
import("$flutter_root/common/config.gni")
import("$flutter_root/lib/ui/dart_ui.gni")
bindings_output_dir = "$root_gen_dir/sky/bindings"
@@ -55,7 +56,8 @@ compiled_action("generate_snapshot_bin") {
rebase_path(isolate_snapshot_instructions),
]
if (is_debug) {
if (is_debug && flutter_runtime_mode != "profile" &&
flutter_runtime_mode != "release") {
args += [ "--enable_asserts" ]
}

View File

@@ -24,6 +24,20 @@ source_set("test_font") {
}
}
# Picks the libdart implementation based on the Flutter runtime mode.
group("libdart") {
deps = []
if (flutter_runtime_mode == "profile" || flutter_runtime_mode == "release") {
deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ]
} else {
deps += [
"$flutter_root/lib/snapshot",
"//third_party/dart/runtime:libdart_jit",
]
}
}
source_set("runtime") {
sources = [
"dart_isolate.cc",

View File

@@ -61,19 +61,10 @@ shared_library("flutter_shell_native") {
"$flutter_root/fml",
"$flutter_root/lib/ui",
"$flutter_root/runtime",
"$flutter_root/runtime:libdart",
"$flutter_root/shell/common",
"//third_party/skia",
]
if (flutter_runtime_mode == "debug" ||
flutter_runtime_mode == "dynamic_profile" ||
flutter_runtime_mode == "dynamic_release") {
deps += [ "//third_party/dart/runtime:libdart_jit" ]
} else {
deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ]
}
if (flutter_runtime_mode == "debug") {
deps += [ "$flutter_root/lib/snapshot" ]
}
public_configs = [ "$flutter_root:config" ]

View File

@@ -109,20 +109,11 @@ shared_library("create_flutter_framework_dylib") {
"$flutter_root/fml",
"$flutter_root/lib/ui",
"$flutter_root/runtime",
"$flutter_root/runtime:libdart",
"$flutter_root/shell/common",
"$flutter_root/shell/platform/darwin/common",
"//third_party/skia",
]
if (flutter_runtime_mode == "debug" ||
flutter_runtime_mode == "dynamic_profile" ||
flutter_runtime_mode == "dynamic_release") {
deps += [
"$flutter_root/lib/snapshot",
"//third_party/dart/runtime:libdart_jit",
]
} else {
deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ]
}
public_configs = [ "$flutter_root:config" ]

View File

@@ -45,21 +45,13 @@ source_set("embedder") {
"$flutter_root/common",
"$flutter_root/flow",
"$flutter_root/fml",
"$flutter_root/runtime:libdart",
"$flutter_root/shell/common",
"//third_party/dart/runtime/bin:dart_io_api",
"//third_party/skia",
"//third_party/tonic",
]
if (flutter_runtime_mode == "profile" || flutter_runtime_mode == "release") {
deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ]
} else {
deps += [
"$flutter_root/lib/snapshot",
"//third_party/dart/runtime:libdart_jit",
]
}
public_configs = [ "$flutter_root:config" ]
}