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-10-21 19:14:04 +00:00
|
|
|
import("../../sdk_args.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")
|
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",
|
|
|
|
]
|
2020-12-04 22:46:12 +00:00
|
|
|
if (target_os != "winuwp") {
|
|
|
|
libs += [ "dbghelp.lib" ]
|
|
|
|
}
|
2016-10-04 16:19:07 +00:00
|
|
|
} else {
|
|
|
|
libs = [ "dl" ]
|
|
|
|
if (!is_android) {
|
2016-10-26 15:50:54 +00:00
|
|
|
libs += [ "pthread" ]
|
2016-10-04 16:19:07 +00:00
|
|
|
}
|
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"
|
2020-06-17 16:12:26 +00:00
|
|
|
extra_product_deps = [
|
|
|
|
"//third_party/icu:icui18n_hidden_visibility",
|
|
|
|
"//third_party/icu:icuuc_hidden_visibility",
|
|
|
|
]
|
|
|
|
extra_nonproduct_deps = [
|
|
|
|
"//third_party/icu:icui18n",
|
|
|
|
"//third_party/icu:icuuc",
|
|
|
|
]
|
2018-05-14 15:26:37 +00:00
|
|
|
if (is_fuchsia) {
|
2020-06-18 00:24:31 +00:00
|
|
|
if (using_fuchsia_gn_sdk) {
|
|
|
|
extra_deps = [
|
2021-02-18 07:38:04 +00:00
|
|
|
"$fuchsia_sdk_root/fidl/fuchsia.intl",
|
2020-07-15 20:44:06 +00:00
|
|
|
"$fuchsia_sdk_root/pkg/async",
|
|
|
|
"$fuchsia_sdk_root/pkg/async-default",
|
|
|
|
"$fuchsia_sdk_root/pkg/async-loop",
|
|
|
|
"$fuchsia_sdk_root/pkg/async-loop-default",
|
2020-06-18 00:24:31 +00:00
|
|
|
"$fuchsia_sdk_root/pkg/inspect",
|
|
|
|
"$fuchsia_sdk_root/pkg/inspect_service_cpp",
|
|
|
|
"$fuchsia_sdk_root/pkg/sys_cpp",
|
|
|
|
"$fuchsia_sdk_root/pkg/sys_inspect_cpp",
|
|
|
|
"$fuchsia_sdk_root/pkg/trace-engine",
|
|
|
|
]
|
|
|
|
} else if (using_fuchsia_sdk) {
|
2020-06-17 16:12:26 +00:00
|
|
|
extra_deps = [
|
2021-02-18 07:38:04 +00:00
|
|
|
"$fuchsia_sdk_root/fidl:fuchsia.intl",
|
2020-07-15 20:44:06 +00:00
|
|
|
"$fuchsia_sdk_root/pkg:async-loop",
|
|
|
|
"$fuchsia_sdk_root/pkg:async-loop-default",
|
2020-04-30 23:16:46 +00:00
|
|
|
"$fuchsia_sdk_root/pkg:inspect",
|
|
|
|
"$fuchsia_sdk_root/pkg:inspect_service_cpp",
|
2019-10-03 04:33:59 +00:00
|
|
|
"$fuchsia_sdk_root/pkg:sys_cpp",
|
2020-04-30 23:16:46 +00:00
|
|
|
"$fuchsia_sdk_root/pkg:sys_inspect_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 {
|
2020-06-17 16:12:26 +00:00
|
|
|
extra_deps = [
|
2021-02-18 07:38:04 +00:00
|
|
|
"//sdk/fidl/fuchsia.intl",
|
2020-02-28 21:52:40 +00:00
|
|
|
"//sdk/lib/sys/cpp",
|
2020-05-13 08:12:11 +00:00
|
|
|
"//sdk/lib/sys/inspect/cpp",
|
2019-05-07 00:43:33 +00:00
|
|
|
"//zircon/public/lib/fbl",
|
2020-05-16 00:04:22 +00:00
|
|
|
"//zircon/system/ulib/trace-engine",
|
2019-05-07 00:43:33 +00:00
|
|
|
]
|
|
|
|
}
|
2017-07-16 04:43:47 +00:00
|
|
|
}
|
2018-05-14 15:26:37 +00:00
|
|
|
public_configs = [ ":libdart_vm_config" ]
|
2020-04-16 22:59:03 +00:00
|
|
|
sources = vm_sources + rebase_path(compiler_api_sources, ".", "./compiler/") +
|
|
|
|
rebase_path(disassembler_sources, ".", "./compiler/") +
|
2018-06-20 00:39:49 +00:00
|
|
|
rebase_path(heap_sources, ".", "./heap/")
|
2018-05-14 15:26:37 +00:00
|
|
|
include_dirs = [ ".." ]
|
2017-03-29 17:12:00 +00:00
|
|
|
}
|
|
|
|
|
2020-04-16 22:59:03 +00:00
|
|
|
library_for_all_configs_with_compiler("libdart_compiler") {
|
|
|
|
target_type = "source_set"
|
|
|
|
public_configs = [ ":libdart_vm_config" ]
|
|
|
|
sources = rebase_path(compiler_sources, ".", "./compiler/")
|
|
|
|
include_dirs = [ ".." ]
|
2020-04-17 20:02:14 +00:00
|
|
|
if (is_fuchsia) {
|
2020-06-18 00:24:31 +00:00
|
|
|
if (using_fuchsia_gn_sdk) {
|
|
|
|
extra_deps = [ "$fuchsia_sdk_root/pkg/trace-engine" ]
|
|
|
|
} else if (using_fuchsia_sdk) {
|
2020-04-17 20:02:14 +00:00
|
|
|
extra_deps = [ "$fuchsia_sdk_root/pkg:trace-engine" ]
|
|
|
|
} else {
|
|
|
|
extra_deps = [
|
|
|
|
"//zircon/public/lib/fbl",
|
2020-05-20 01:33:21 +00:00
|
|
|
"//zircon/system/ulib/trace-engine",
|
2020-04-17 20:02:14 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
2020-04-16 22:59:03 +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) {
|
2020-06-18 00:24:31 +00:00
|
|
|
if (using_fuchsia_gn_sdk) {
|
|
|
|
extra_deps = [ "$fuchsia_sdk_root/pkg/trace-engine" ]
|
|
|
|
} else if (using_fuchsia_sdk) {
|
2019-10-18 01:33:03 +00:00
|
|
|
extra_deps = [ "$fuchsia_sdk_root/pkg:trace-engine" ]
|
|
|
|
} else {
|
2019-05-07 00:43:33 +00:00
|
|
|
extra_deps = [
|
|
|
|
"//zircon/public/lib/fbl",
|
2020-05-16 00:04:22 +00:00
|
|
|
"//zircon/system/ulib/trace-engine",
|
2019-05-07 00:43:33 +00:00
|
|
|
]
|
|
|
|
}
|
2019-03-01 18:05:40 +00:00
|
|
|
}
|
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 +
|
2020-11-13 20:40:24 +00:00
|
|
|
ffi_runtime_cc_files
|
2018-10-02 23:27:05 +00:00
|
|
|
sources = [ "bootstrap.cc" ] + rebase_path(allsources, ".", "../lib")
|
|
|
|
snapshot_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'")
|
2020-06-17 16:12:26 +00:00
|
|
|
is_product_flag = dart_runtime_mode == "release"
|
|
|
|
if (defined(invoker.product_mode)) {
|
|
|
|
is_product_flag = invoker.product_mode
|
|
|
|
}
|
2019-02-21 18:22:39 +00:00
|
|
|
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("../../")
|
2020-06-16 23:37:36 +00:00
|
|
|
libraries_specification_uri = "org-dartlang-sdk:///sdk/lib/libraries.json"
|
2019-02-21 18:22:39 +00:00
|
|
|
outputs = [
|
|
|
|
"$root_out_dir/vm_platform" + output_postfix + ".dill",
|
|
|
|
"$root_out_dir/vm_outline" + output_postfix + ".dill",
|
|
|
|
]
|
|
|
|
args = [ "dart:core" ]
|
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.isVM=true",
|
2020-06-16 23:37:36 +00:00
|
|
|
"--nnbd-agnostic",
|
2019-04-02 19:53:09 +00:00
|
|
|
]
|
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
|
|
|
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
|
|
|
|
2020-06-17 16:12:26 +00:00
|
|
|
gen_vm_platform("vm_platform_product") {
|
|
|
|
add_implicit_vm_platform_dependency = false
|
|
|
|
exclude_source = false
|
|
|
|
output_postfix = "_strong_product"
|
|
|
|
|
|
|
|
# In Debug mode we use debug binaries for dart2native.
|
|
|
|
# (see also the "dart_product_config" config)
|
|
|
|
product_mode = !is_debug
|
|
|
|
}
|
|
|
|
|
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"
|
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",
|
2020-01-27 15:59:56 +00:00
|
|
|
"..:dart_maybe_product_config",
|
2019-06-03 22:14:16 +00:00
|
|
|
":libdart_vm_config",
|
|
|
|
]
|
2020-04-30 23:16:46 +00:00
|
|
|
sources = [ "compiler/offsets_extractor.cc" ]
|
2019-06-03 22:14:16 +00:00
|
|
|
include_dirs = [ ".." ]
|
|
|
|
}
|
2020-01-24 22:03:05 +00:00
|
|
|
|
|
|
|
executable("offsets_extractor_precompiled_runtime") {
|
|
|
|
configs += [
|
|
|
|
"..:dart_arch_config",
|
|
|
|
"..:dart_config",
|
|
|
|
"..:dart_precompiled_runtime_config",
|
2020-01-27 15:59:56 +00:00
|
|
|
"..:dart_maybe_product_config",
|
2020-01-24 22:03:05 +00:00
|
|
|
":libdart_vm_config",
|
|
|
|
]
|
2020-04-30 23:16:46 +00:00
|
|
|
sources = [ "compiler/offsets_extractor.cc" ]
|
2020-01-24 22:03:05 +00:00
|
|
|
include_dirs = [ ".." ]
|
|
|
|
}
|