2014-11-11 22:03:55 +00:00
|
|
|
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
|
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
2016-11-10 19:16:24 +00:00
|
|
|
import("../../build/executable_suffix.gni")
|
2017-08-15 04:54:34 +00:00
|
|
|
import("../../sdk/lib/async/async_sources.gni")
|
|
|
|
import("../../sdk/lib/collection/collection_sources.gni")
|
|
|
|
import("../../sdk/lib/convert/convert_sources.gni")
|
|
|
|
import("../../sdk/lib/core/core_sources.gni")
|
|
|
|
import("../../sdk/lib/developer/developer_sources.gni")
|
2019-02-13 12:42:47 +00:00
|
|
|
import("../../sdk/lib/ffi/ffi_sources.gni")
|
2017-08-15 04:54:34 +00:00
|
|
|
import("../../sdk/lib/internal/internal_sources.gni")
|
|
|
|
import("../../sdk/lib/isolate/isolate_sources.gni")
|
|
|
|
import("../../sdk/lib/math/math_sources.gni")
|
|
|
|
import("../../sdk/lib/mirrors/mirrors_sources.gni")
|
|
|
|
import("../../sdk/lib/typed_data/typed_data_sources.gni")
|
|
|
|
import("../../sdk/lib/vmservice/vmservice_sources.gni")
|
2019-08-28 23:11:21 +00:00
|
|
|
import("../../sdk/lib/wasm/wasm_sources.gni")
|
2017-10-17 11:29:50 +00:00
|
|
|
import("../../utils/compile_platform.gni")
|
2018-01-18 16:38:54 +00:00
|
|
|
import("../bin/cli_sources.gni")
|
2019-02-13 12:42:47 +00:00
|
|
|
import("../bin/io_sources.gni")
|
|
|
|
import("../configs.gni")
|
2017-08-15 04:54:34 +00:00
|
|
|
import("../lib/async_sources.gni")
|
|
|
|
import("../lib/collection_sources.gni")
|
|
|
|
import("../lib/convert_sources.gni")
|
|
|
|
import("../lib/core_sources.gni")
|
|
|
|
import("../lib/developer_sources.gni")
|
2019-02-13 12:42:47 +00:00
|
|
|
import("../lib/ffi_sources.gni")
|
2017-08-15 04:54:34 +00:00
|
|
|
import("../lib/internal_sources.gni")
|
|
|
|
import("../lib/isolate_sources.gni")
|
|
|
|
import("../lib/math_sources.gni")
|
|
|
|
import("../lib/mirrors_sources.gni")
|
|
|
|
import("../lib/profiler_sources.gni")
|
|
|
|
import("../lib/typed_data_sources.gni")
|
|
|
|
import("../lib/vmservice_sources.gni")
|
2019-08-28 23:11:21 +00:00
|
|
|
import("../lib/wasm_sources.gni")
|
2017-01-06 20:38:11 +00:00
|
|
|
import("../runtime_args.gni")
|
2017-09-04 14:18:37 +00:00
|
|
|
import("compiler/compiler_sources.gni")
|
2018-06-20 00:39:49 +00:00
|
|
|
import("heap/heap_sources.gni")
|
2017-08-15 04:54:34 +00:00
|
|
|
import("vm_sources.gni")
|
2016-11-01 19:59:36 +00:00
|
|
|
|
2019-05-07 00:43:33 +00:00
|
|
|
if (is_fuchsia) {
|
|
|
|
import("//build/fuchsia/sdk.gni")
|
|
|
|
}
|
|
|
|
|
2014-11-11 22:03:55 +00:00
|
|
|
config("libdart_vm_config") {
|
2017-05-21 06:30:06 +00:00
|
|
|
if (is_fuchsia) {
|
2018-02-05 14:35:36 +00:00
|
|
|
libs = [ "zircon" ]
|
2016-10-04 16:19:07 +00:00
|
|
|
} else if (is_win) {
|
|
|
|
libs = [
|
|
|
|
"advapi32.lib",
|
|
|
|
"shell32.lib",
|
|
|
|
"dbghelp.lib",
|
|
|
|
]
|
|
|
|
} else {
|
|
|
|
libs = [ "dl" ]
|
|
|
|
if (!is_android) {
|
2016-10-26 15:50:54 +00:00
|
|
|
libs += [ "pthread" ]
|
2016-10-04 16:19:07 +00:00
|
|
|
}
|
|
|
|
if (is_linux) {
|
|
|
|
libs += [ "rt" ]
|
|
|
|
}
|
2015-01-26 20:59:03 +00:00
|
|
|
}
|
2014-11-11 22:03:55 +00:00
|
|
|
}
|
|
|
|
|
2018-05-14 15:26:37 +00:00
|
|
|
library_for_all_configs("libdart_vm") {
|
|
|
|
target_type = "source_set"
|
2019-04-29 09:11:48 +00:00
|
|
|
extra_deps = [ "//third_party/icu" ]
|
2018-05-14 15:26:37 +00:00
|
|
|
if (is_fuchsia) {
|
2019-05-07 00:43:33 +00:00
|
|
|
if (using_fuchsia_sdk) {
|
2019-10-03 04:33:59 +00:00
|
|
|
extra_deps += [
|
|
|
|
"$fuchsia_sdk_root/fidl:fuchsia.deprecatedtimezone",
|
|
|
|
"$fuchsia_sdk_root/pkg:sys_cpp",
|
2019-10-18 01:33:03 +00:00
|
|
|
"$fuchsia_sdk_root/pkg:trace-engine",
|
2019-10-03 04:33:59 +00:00
|
|
|
]
|
2019-05-07 00:43:33 +00:00
|
|
|
} else {
|
|
|
|
extra_deps += [
|
|
|
|
# TODO(US-399): Remove time_service specific code when it is no longer
|
|
|
|
# necessary.
|
|
|
|
"//sdk/lib/sys/cpp",
|
|
|
|
"//sdk/fidl/fuchsia.timezone",
|
2018-05-14 15:26:37 +00:00
|
|
|
|
2019-05-07 00:43:33 +00:00
|
|
|
"//zircon/public/lib/fbl",
|
|
|
|
"//zircon/public/lib/trace-engine",
|
|
|
|
]
|
|
|
|
}
|
2017-07-16 04:43:47 +00:00
|
|
|
}
|
2018-05-14 15:26:37 +00:00
|
|
|
public_configs = [ ":libdart_vm_config" ]
|
|
|
|
set_sources_assignment_filter([
|
|
|
|
"*_test.cc",
|
|
|
|
"*_test.h",
|
|
|
|
])
|
2018-06-20 00:39:49 +00:00
|
|
|
sources = vm_sources + rebase_path(compiler_sources, ".", "./compiler/") +
|
|
|
|
rebase_path(heap_sources, ".", "./heap/")
|
2018-05-14 15:26:37 +00:00
|
|
|
include_dirs = [ ".." ]
|
2017-03-29 17:12:00 +00:00
|
|
|
}
|
|
|
|
|
2018-10-02 23:27:05 +00:00
|
|
|
library_for_all_configs("libdart_lib") {
|
|
|
|
target_type = "source_set"
|
2019-03-01 18:05:40 +00:00
|
|
|
if (is_fuchsia) {
|
2019-10-18 01:33:03 +00:00
|
|
|
if (using_fuchsia_sdk) {
|
|
|
|
extra_deps = [ "$fuchsia_sdk_root/pkg:trace-engine" ]
|
|
|
|
} else {
|
2019-05-07 00:43:33 +00:00
|
|
|
extra_deps = [
|
|
|
|
"//zircon/public/lib/fbl",
|
|
|
|
"//zircon/public/lib/trace-engine",
|
|
|
|
]
|
|
|
|
}
|
2019-03-01 18:05:40 +00:00
|
|
|
}
|
2019-09-13 18:25:16 +00:00
|
|
|
if (dart_enable_wasm) {
|
|
|
|
defines = [ "DART_ENABLE_WASM" ]
|
|
|
|
}
|
2018-10-02 23:27:05 +00:00
|
|
|
include_dirs = [ ".." ]
|
2019-05-21 17:01:48 +00:00
|
|
|
allsources = async_runtime_cc_files + collection_runtime_cc_files +
|
|
|
|
core_runtime_cc_files + developer_runtime_cc_files +
|
|
|
|
internal_runtime_cc_files + isolate_runtime_cc_files +
|
|
|
|
math_runtime_cc_files + mirrors_runtime_cc_files +
|
|
|
|
typed_data_runtime_cc_files + vmservice_runtime_cc_files +
|
2019-08-28 23:11:21 +00:00
|
|
|
ffi_runtime_cc_files + wasm_runtime_cc_files
|
2018-10-02 23:27:05 +00:00
|
|
|
sources = [ "bootstrap.cc" ] + rebase_path(allsources, ".", "../lib")
|
|
|
|
snapshot_sources = []
|
|
|
|
nosnapshot_sources = []
|
2014-11-11 22:03:55 +00:00
|
|
|
}
|
2016-10-27 08:09:22 +00:00
|
|
|
|
2019-02-21 18:22:39 +00:00
|
|
|
template("gen_vm_platform") {
|
|
|
|
assert(defined(invoker.output_postfix),
|
|
|
|
"Must define output postfix (e.g., '_strong'")
|
|
|
|
compile_platform(target_name) {
|
|
|
|
output_postfix = invoker.output_postfix
|
|
|
|
if (defined(invoker.add_implicit_vm_platform_dependency)) {
|
|
|
|
add_implicit_vm_platform_dependency =
|
|
|
|
invoker.add_implicit_vm_platform_dependency
|
|
|
|
}
|
|
|
|
single_root_scheme = "org-dartlang-sdk"
|
|
|
|
single_root_base = rebase_path("../../")
|
|
|
|
libraries_specification_uri = "org-dartlang-sdk:///sdk/lib/libraries.json"
|
|
|
|
outputs = [
|
|
|
|
"$root_out_dir/vm_platform" + output_postfix + ".dill",
|
|
|
|
"$root_out_dir/vm_outline" + output_postfix + ".dill",
|
|
|
|
]
|
|
|
|
args = [ "dart:core" ]
|
2019-04-03 17:06:47 +00:00
|
|
|
is_product_flag = dart_runtime_mode == "release"
|
|
|
|
allow_causal_async_stacks = !is_product_flag
|
2019-04-02 19:53:09 +00:00
|
|
|
args += [
|
2019-04-03 17:06:47 +00:00
|
|
|
"-Ddart.vm.product=$is_product_flag",
|
2019-04-02 19:53:09 +00:00
|
|
|
"-Ddart.developer.causal_async_stacks=$allow_causal_async_stacks",
|
|
|
|
"-Ddart.isVM=true",
|
|
|
|
]
|
2019-02-21 18:22:39 +00:00
|
|
|
if (defined(invoker.exclude_source) && invoker.exclude_source) {
|
|
|
|
args += [ "--exclude-source" ]
|
|
|
|
}
|
2019-09-23 23:08:41 +00:00
|
|
|
if (defined(invoker.bytecode) && invoker.bytecode) {
|
2019-02-21 18:22:39 +00:00
|
|
|
args += [ "--bytecode" ]
|
|
|
|
}
|
2019-09-23 23:08:41 +00:00
|
|
|
outline = "vm_outline" + output_postfix + ".dill"
|
2019-02-21 18:22:39 +00:00
|
|
|
}
|
|
|
|
}
|
2017-10-06 15:34:37 +00:00
|
|
|
|
2019-02-21 18:22:39 +00:00
|
|
|
gen_vm_platform("vm_platform") {
|
2018-06-13 20:49:54 +00:00
|
|
|
add_implicit_vm_platform_dependency = false
|
2019-02-21 18:22:39 +00:00
|
|
|
exclude_source = false
|
|
|
|
output_postfix = "_strong"
|
|
|
|
}
|
2018-06-13 20:49:54 +00:00
|
|
|
|
2019-02-21 18:22:39 +00:00
|
|
|
gen_vm_platform("vm_platform_stripped") {
|
|
|
|
add_implicit_vm_platform_dependency = false
|
|
|
|
exclude_source = true
|
|
|
|
output_postfix = "_strong_stripped"
|
2019-09-23 23:08:41 +00:00
|
|
|
|
|
|
|
if (dart_platform_bytecode) {
|
|
|
|
bytecode = true
|
|
|
|
}
|
2017-10-06 20:12:59 +00:00
|
|
|
}
|
|
|
|
|
2017-10-06 15:34:37 +00:00
|
|
|
group("kernel_platform_files") {
|
|
|
|
public_deps = [
|
2017-10-17 11:29:50 +00:00
|
|
|
":vm_platform",
|
2019-02-21 18:22:39 +00:00
|
|
|
":vm_platform_stripped",
|
2017-10-06 15:34:37 +00:00
|
|
|
]
|
|
|
|
}
|
2019-06-03 22:14:16 +00:00
|
|
|
|
|
|
|
executable("offsets_extractor") {
|
|
|
|
configs += [
|
|
|
|
"..:dart_arch_config",
|
|
|
|
"..:dart_config",
|
|
|
|
":libdart_vm_config",
|
|
|
|
]
|
|
|
|
sources = [
|
|
|
|
"compiler/offsets_extractor.cc",
|
|
|
|
]
|
|
|
|
include_dirs = [ ".." ]
|
|
|
|
}
|