393468dc89
This commit is being done so we can roll it into Flutter and run some device lab testing to see the effect this CL will have on Flutter. [BUILD] - Initial CL to unfork the NNBD Dart SDK - Flips the flag from --nnbd to --no-nnbd so that by default it builds the NNBD version - using the --no-nnbd flag results in the SDK being built in a directory which has the 'Legacy' suffix added to it (e.g: out/DebugX64Legacy) - the '--enable-experiment=non-nullable' flag still needs to be passed in during execution so that CFE runs in that mode. This is different from the 'null_safety' flag Change-Id: I83c813aee2a5b61ad876d8a7b0988705bb24c839 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144082 Reviewed-by: Siva Annamalai <asiva@google.com>
234 lines
7.1 KiB
Plaintext
234 lines
7.1 KiB
Plaintext
# 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.
|
|
|
|
import("../../build/executable_suffix.gni")
|
|
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")
|
|
import("../../sdk/lib/ffi/ffi_sources.gni")
|
|
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")
|
|
import("../../sdk/lib/wasm/wasm_sources.gni")
|
|
import("../../sdk_args.gni")
|
|
import("../../utils/compile_platform.gni")
|
|
import("../bin/cli_sources.gni")
|
|
import("../bin/io_sources.gni")
|
|
import("../configs.gni")
|
|
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")
|
|
import("../lib/ffi_sources.gni")
|
|
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")
|
|
import("../lib/wasm_sources.gni")
|
|
import("../runtime_args.gni")
|
|
import("compiler/compiler_sources.gni")
|
|
import("heap/heap_sources.gni")
|
|
import("vm_sources.gni")
|
|
|
|
if (is_fuchsia) {
|
|
import("//build/fuchsia/sdk.gni")
|
|
}
|
|
|
|
config("libdart_vm_config") {
|
|
if (is_fuchsia) {
|
|
libs = [ "zircon" ]
|
|
} else if (is_win) {
|
|
libs = [
|
|
"advapi32.lib",
|
|
"shell32.lib",
|
|
"dbghelp.lib",
|
|
]
|
|
} else {
|
|
libs = [ "dl" ]
|
|
if (!is_android) {
|
|
libs += [ "pthread" ]
|
|
}
|
|
if (is_linux) {
|
|
libs += [ "rt" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
library_for_all_configs("libdart_vm") {
|
|
target_type = "source_set"
|
|
extra_deps = [ "//third_party/icu" ]
|
|
if (is_fuchsia) {
|
|
if (using_fuchsia_sdk) {
|
|
extra_deps += [
|
|
"$fuchsia_sdk_root/fidl:fuchsia.deprecatedtimezone",
|
|
"$fuchsia_sdk_root/pkg:sys_cpp",
|
|
"$fuchsia_sdk_root/pkg:trace-engine",
|
|
]
|
|
} else {
|
|
extra_deps += [
|
|
# TODO(US-399): Remove time_service specific code when it is no longer
|
|
# necessary.
|
|
"//sdk/fidl/fuchsia.deprecatedtimezone",
|
|
"//sdk/lib/sys/cpp",
|
|
"//zircon/public/lib/fbl",
|
|
"//zircon/public/lib/trace-engine",
|
|
]
|
|
}
|
|
}
|
|
public_configs = [ ":libdart_vm_config" ]
|
|
set_sources_assignment_filter([
|
|
"*_test.cc",
|
|
"*_test.h",
|
|
])
|
|
sources = vm_sources + rebase_path(compiler_api_sources, ".", "./compiler/") +
|
|
rebase_path(disassembler_sources, ".", "./compiler/") +
|
|
rebase_path(heap_sources, ".", "./heap/")
|
|
include_dirs = [ ".." ]
|
|
}
|
|
|
|
library_for_all_configs_with_compiler("libdart_compiler") {
|
|
target_type = "source_set"
|
|
public_configs = [ ":libdart_vm_config" ]
|
|
set_sources_assignment_filter([
|
|
"*_test.cc",
|
|
"*_test.h",
|
|
])
|
|
sources = rebase_path(compiler_sources, ".", "./compiler/")
|
|
include_dirs = [ ".." ]
|
|
if (is_fuchsia) {
|
|
if (using_fuchsia_sdk) {
|
|
extra_deps = [ "$fuchsia_sdk_root/pkg:trace-engine" ]
|
|
} else {
|
|
extra_deps = [
|
|
"//zircon/public/lib/fbl",
|
|
"//zircon/public/lib/trace-engine",
|
|
]
|
|
}
|
|
}
|
|
}
|
|
|
|
library_for_all_configs("libdart_lib") {
|
|
target_type = "source_set"
|
|
if (is_fuchsia) {
|
|
if (using_fuchsia_sdk) {
|
|
extra_deps = [ "$fuchsia_sdk_root/pkg:trace-engine" ]
|
|
} else {
|
|
extra_deps = [
|
|
"//zircon/public/lib/fbl",
|
|
"//zircon/public/lib/trace-engine",
|
|
]
|
|
}
|
|
}
|
|
if (dart_enable_wasm) {
|
|
defines = [ "DART_ENABLE_WASM" ]
|
|
}
|
|
include_dirs = [ ".." ]
|
|
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 +
|
|
ffi_runtime_cc_files + wasm_runtime_cc_files
|
|
sources = [ "bootstrap.cc" ] + rebase_path(allsources, ".", "../lib")
|
|
snapshot_sources = []
|
|
}
|
|
|
|
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("../../")
|
|
if (!dont_use_nnbd) {
|
|
libraries_specification_uri =
|
|
"org-dartlang-sdk:///sdk_nnbd/lib/libraries.json"
|
|
} else {
|
|
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" ]
|
|
is_product_flag = dart_runtime_mode == "release"
|
|
allow_causal_async_stacks = !is_product_flag
|
|
args += [
|
|
"-Ddart.vm.product=$is_product_flag",
|
|
"-Ddart.developer.causal_async_stacks=$allow_causal_async_stacks",
|
|
"-Ddart.isVM=true",
|
|
]
|
|
if (!dont_use_nnbd) {
|
|
args += [ "--enable-experiment=non-nullable" ]
|
|
args += [ "--nnbd-agnostic" ]
|
|
}
|
|
if (defined(invoker.exclude_source) && invoker.exclude_source) {
|
|
args += [ "--exclude-source" ]
|
|
}
|
|
if (defined(invoker.bytecode) && invoker.bytecode) {
|
|
args += [ "--bytecode" ]
|
|
}
|
|
outline = "vm_outline" + output_postfix + ".dill"
|
|
}
|
|
}
|
|
|
|
gen_vm_platform("vm_platform") {
|
|
add_implicit_vm_platform_dependency = false
|
|
exclude_source = false
|
|
output_postfix = "_strong"
|
|
}
|
|
|
|
gen_vm_platform("vm_platform_stripped") {
|
|
add_implicit_vm_platform_dependency = false
|
|
exclude_source = true
|
|
output_postfix = "_strong_stripped"
|
|
|
|
if (dart_platform_bytecode) {
|
|
bytecode = true
|
|
}
|
|
}
|
|
|
|
group("kernel_platform_files") {
|
|
public_deps = [
|
|
":vm_platform",
|
|
":vm_platform_stripped",
|
|
]
|
|
}
|
|
|
|
executable("offsets_extractor") {
|
|
configs += [
|
|
"..:dart_arch_config",
|
|
"..:dart_config",
|
|
"..:dart_maybe_product_config",
|
|
":libdart_vm_config",
|
|
]
|
|
sources = [ "compiler/offsets_extractor.cc" ]
|
|
include_dirs = [ ".." ]
|
|
}
|
|
|
|
executable("offsets_extractor_precompiled_runtime") {
|
|
configs += [
|
|
"..:dart_arch_config",
|
|
"..:dart_config",
|
|
"..:dart_precompiled_runtime_config",
|
|
"..:dart_maybe_product_config",
|
|
":libdart_vm_config",
|
|
]
|
|
sources = [ "compiler/offsets_extractor.cc" ]
|
|
include_dirs = [ ".." ]
|
|
}
|