GN: Add libdart_jit and dart_api.

libdart_jit is always the JIT, unlike libdart which is either the JIT or AOT runtime depending on dart_runtime_mode. Clients of libdart will be updated to explicitly choose libdart_jit or libdart_precompiled_runtime.

dart_api allows libraries such as tonic or intermediate components of the Flutter engine to be agnostic as to whether they're in a JIT or AOT runtime, allowing the final executable making the choice without having to deal with a conflicting dependency brought in by a library.

Remove dead libdart_embedder_noio.

Replace all used of dart_nosnapshot* with dart_nosnapshot_with_precompiler*. We don't care about binary size of their clients, so it's better to have fewer targets.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2814513003 .
This commit is contained in:
Ryan Macnak 2017-04-10 13:44:21 -07:00
parent 94df115e4b
commit 42ec925a9e
3 changed files with 53 additions and 40 deletions

View file

@ -203,6 +203,16 @@ config("dart_config") {
}
}
source_set("dart_api") {
public_configs = [ ":dart_public_config" ]
sources = [
"include/dart_api.h",
"include/dart_mirrors_api.h",
"include/dart_native_api.h",
"include/dart_tools_api.h",
]
}
template("libdart_library") {
extra_configs = []
if (defined(invoker.extra_configs)) {
@ -240,6 +250,8 @@ template("libdart_library") {
}
}
# TODO(rmacnak): Remove after updating all clients to use libdart_jit
# or libdart_precompiled_runtime.
libdart_library("libdart") {
extra_configs = [ ":dart_maybe_precompiled_runtime_config" ]
extra_deps = [
@ -248,6 +260,13 @@ libdart_library("libdart") {
]
}
libdart_library("libdart_jit") {
extra_deps = [
"vm:libdart_lib_jit",
"vm:libdart_vm_jit",
]
}
libdart_library("libdart_precompiled_runtime") {
extra_configs = [ ":dart_precompiled_runtime_config" ]
extra_deps = [
@ -256,17 +275,6 @@ libdart_library("libdart_precompiled_runtime") {
]
}
libdart_library("libdart_nosnapshot") {
extra_configs = [
":dart_no_snapshot_config",
":dart_maybe_precompiled_runtime_config",
]
extra_deps = [
"vm:libdart_lib_nosnapshot",
"vm:libdart_vm_nosnapshot",
]
}
libdart_library("libdart_nosnapshot_with_precompiler") {
extra_configs = [
":dart_no_snapshot_config",
@ -318,10 +326,10 @@ executable("libdart_dependency_helper") {
]
deps = [
"third_party/double-conversion/src:libdouble_conversion",
"vm:libdart_lib",
"vm:libdart_lib_nosnapshot",
"vm:libdart_vm",
"vm:libdart_vm_nosnapshot",
"vm:libdart_lib_jit",
"vm:libdart_lib_nosnapshot_with_precompiler",
"vm:libdart_vm_jit",
"vm:libdart_vm_nosnapshot_with_precompiler",
]
sources = [
"vm/libdart_dependency_helper.cc",

View file

@ -367,16 +367,6 @@ source_set("gen_snapshot_dart_io") {
]
}
source_set("libdart_embedder_noio") {
configs += [
"..:dart_config",
"..:dart_maybe_product_config",
]
deps = [
"..:libdart",
]
}
# A source set for the implementation of 'dart:io' library.
template("dart_io") {
extra_sources = []
@ -417,9 +407,7 @@ template("dart_io") {
libs += [ "CoreServices.framework" ]
}
} else {
deps += [
"//third_party/boringssl",
]
deps += [ "//third_party/boringssl" ]
}
if (defined(is_fuchsia) && is_fuchsia) {
@ -626,7 +614,7 @@ template("dart_executable") {
dart_executable("dart") {
extra_deps = [
"..:libdart",
"..:libdart_jit",
":dart_snapshot_cc",
"../observatory:standalone_observatory_archive",
]
@ -788,7 +776,7 @@ executable("run_vm_tests") {
":libdart_builtin",
":standalone_dart_io",
"$dart_zlib_path",
"..:libdart",
"..:libdart_jit",
]
include_dirs = [
"..",

View file

@ -41,6 +41,8 @@ static_library("libdart_platform") {
vm_sources_list = processed_gypis.vm_sources
# TODO(rmacnak): Remove after updating all clients of libdart to use
# libdart_jit or libdart_precompiled_runtime.
static_library("libdart_vm") {
configs += [
"..:dart_config",
@ -56,6 +58,20 @@ static_library("libdart_vm") {
include_dirs = [ ".." ]
}
static_library("libdart_vm_jit") {
configs += [
"..:dart_config",
"..:dart_maybe_product_config",
]
public_configs = [ ":libdart_vm_config" ]
set_sources_assignment_filter([
"*_test.cc",
"*_test.h",
])
sources = vm_sources_list
include_dirs = [ ".." ]
}
static_library("libdart_vm_precompiled_runtime") {
configs += [
"..:dart_config",
@ -212,16 +228,6 @@ template("generate_core_libraries") {
all_libsources = rebase_path(invoker.allsources, ".", "../lib")
static_library("libdart_lib_nosnapshot") {
configs += [
"..:dart_config",
"..:dart_maybe_product_config",
"..:dart_maybe_precompiled_runtime_config",
]
deps = libdeps
sources = all_libsources + [ "bootstrap.cc" ] + liboutputs
include_dirs = [ ".." ]
}
static_library("libdart_lib_nosnapshot_with_precompiler") {
configs += [
"..:dart_config",
@ -242,6 +248,9 @@ template("generate_core_libraries") {
sources = all_libsources + [ "bootstrap_nocore.cc" ]
include_dirs = [ ".." ]
}
# TODO(rmacnak): Remove after updating all clients of libdart to use
# libdart_jit or libdart_precompiled_runtime.
static_library("libdart_lib") {
configs += [
"..:dart_config",
@ -251,6 +260,14 @@ template("generate_core_libraries") {
sources = all_libsources + [ "bootstrap_nocore.cc" ]
include_dirs = [ ".." ]
}
static_library("libdart_lib_jit") {
configs += [
"..:dart_config",
"..:dart_maybe_product_config",
]
sources = all_libsources + [ "bootstrap_nocore.cc" ]
include_dirs = [ ".." ]
}
static_library("libdart_lib_precompiled_runtime") {
configs += [
"..:dart_config",