| Index: runtime/vm/BUILD.gn
|
| diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn
|
| index 0634496bc59b76a131deec048f35c97d6ad484c1..db212e7660dd10774142df21271602fbd8e78856 100644
|
| --- a/runtime/vm/BUILD.gn
|
| +++ b/runtime/vm/BUILD.gn
|
| @@ -2,6 +2,8 @@
|
| # 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("gypi_contents.gni")
|
| +
|
| config("libdart_vm_config") {
|
| if (defined(is_fuchsia) && is_fuchsia) {
|
| libs = [ "magenta" ]
|
| @@ -29,30 +31,12 @@ static_library("libdart_platform") {
|
| ]
|
| public_configs = [ ":libdart_vm_config" ]
|
|
|
| - platform_headers_gypi =
|
| - exec_script("../../tools/gypi_to_gn.py",
|
| - [ rebase_path("../platform/platform_headers.gypi") ],
|
| - "scope",
|
| - [ "../platform/platform_headers.gypi" ])
|
| - platform_headers =
|
| - rebase_path(platform_headers_gypi.sources, ".", "../platform")
|
| -
|
| - platform_sources_gypi =
|
| - exec_script("../../tools/gypi_to_gn.py",
|
| - [ rebase_path("../platform/platform_sources.gypi") ],
|
| - "scope",
|
| - [ "../platform/platform_sources.gypi" ])
|
| - platform_sources =
|
| - rebase_path(platform_sources_gypi.sources, ".", "../platform")
|
| -
|
| - sources = platform_headers + platform_sources
|
| + sources = rebase_path(processed_gypis.platform_sources, ".", "../platform")
|
| +
|
| include_dirs = [ ".." ]
|
| }
|
|
|
| -vm_sources_list = exec_script("../../tools/gypi_to_gn.py",
|
| - [ rebase_path("vm_sources.gypi") ],
|
| - "scope",
|
| - [ "vm_sources.gypi" ])
|
| +vm_sources_list = processed_gypis.vm_sources
|
|
|
| static_library("libdart_vm") {
|
| configs += [
|
| @@ -65,7 +49,7 @@ static_library("libdart_vm") {
|
| "*_test.cc",
|
| "*_test.h",
|
| ])
|
| - sources = vm_sources_list.sources
|
| + sources = vm_sources_list
|
| include_dirs = [ ".." ]
|
| }
|
|
|
| @@ -81,7 +65,7 @@ static_library("libdart_vm_noopt") {
|
| "*_test.cc",
|
| "*_test.h",
|
| ])
|
| - sources = vm_sources_list.sources
|
| + sources = vm_sources_list
|
| include_dirs = [ ".." ]
|
| }
|
|
|
| @@ -96,7 +80,7 @@ static_library("libdart_vm_precompiled_runtime") {
|
| "*_test.cc",
|
| "*_test.h",
|
| ])
|
| - sources = vm_sources_list.sources
|
| + sources = vm_sources_list
|
| include_dirs = [ ".." ]
|
| }
|
|
|
| @@ -112,7 +96,7 @@ static_library("libdart_vm_nosnapshot") {
|
| "*_test.cc",
|
| "*_test.h",
|
| ])
|
| - sources = vm_sources_list.sources
|
| + sources = vm_sources_list
|
| include_dirs = [ ".." ]
|
| }
|
|
|
| @@ -128,7 +112,7 @@ static_library("libdart_vm_nosnapshot_precompiled_runtime") {
|
| "*_test.cc",
|
| "*_test.h",
|
| ])
|
| - sources = vm_sources_list.sources
|
| + sources = vm_sources_list
|
| include_dirs = [ ".." ]
|
| }
|
|
|
| @@ -144,25 +128,24 @@ static_library("libdart_vm_nosnapshot_with_precompiler") {
|
| "*_test.cc",
|
| "*_test.h",
|
| ])
|
| - sources = vm_sources_list.sources
|
| + sources = vm_sources_list
|
| include_dirs = [ ".." ]
|
| }
|
|
|
| template("process_library_source") {
|
| assert(defined(invoker.filename), "Need filename in $target_name")
|
| + assert(defined(invoker.type), "Need type in $target_name")
|
| assert(defined(invoker.output), "Need output in $target_name")
|
| + assert(defined(invoker.type), "Need type in $target_name")
|
| assert(defined(invoker.path), "Need path in $target_name")
|
| action(target_name) {
|
| visibility = [ ":*" ] # Only targets in this file can see this.
|
| filename = invoker.filename
|
| + type = invoker.type
|
| path = invoker.path
|
|
|
| - lib_sources_gypi =
|
| - exec_script("../../tools/gypi_to_gn.py",
|
| - [ rebase_path("${path}/${filename}_sources.gypi") ],
|
| - "scope",
|
| - [ "${path}/${filename}_sources.gypi" ])
|
| - lib_sources = rebase_path(lib_sources_gypi.sources, ".", path)
|
| + lib_sources =
|
| + rebase_path(processed_gypis["${filename}_${type}_sources"], ".", path)
|
|
|
| script = invoker.script
|
| inputs = invoker.inputs + [ script ]
|
| @@ -178,15 +161,21 @@ template("generate_library_source") {
|
| assert(defined(invoker.libname), "Need libname in $target_name")
|
| assert(defined(invoker.filename), "Need a filename in $target_name")
|
| assert(defined(invoker.kind), "Need kind in $target_name")
|
| + assert(defined(invoker.type), "Need type in $target_name")
|
| assert(defined(invoker.output), "Need output in $target_name")
|
| - assert(defined(invoker.path), "Need path in $target_name")
|
|
|
| process_library_source(target_name) {
|
| libname = invoker.libname
|
| filename = invoker.filename
|
| kind = invoker.kind
|
| + type = invoker.type
|
| output = invoker.output
|
| - path = invoker.path
|
| +
|
| + if (type == "sdk") {
|
| + path = "../../sdk/lib/" + filename
|
| + } else {
|
| + path = "../lib"
|
| + }
|
| script = "../tools/gen_library_src_paths.py"
|
| inputs = [
|
| "../lib/libgen_in.cc",
|
| @@ -223,34 +212,28 @@ template("generate_core_libraries") {
|
| libdeps = []
|
| foreach(lib, invoker.sources) {
|
| libname = lib[0]
|
| - filename = lib[1]
|
| - do_patch = lib[2]
|
| - source_path = lib[3]
|
| + type = lib[1]
|
| + filename = lib[2]
|
| + do_patch = lib[3]
|
| generate_library_source("generate_${filename}_cc_file") {
|
| libname = libname
|
| filename = filename
|
| kind = "source"
|
| - path = source_path
|
| + type = type
|
| output = "$target_gen_dir/${filename}_gen.cc"
|
| }
|
| if (do_patch) {
|
| - patch_path = lib[4]
|
| generate_library_source("generate_${filename}_patch_cc_file") {
|
| libname = libname
|
| filename = filename
|
| kind = "patch"
|
| - path = patch_path
|
| + type = "runtime"
|
| output = "$target_gen_dir/${filename}_patch_gen.cc"
|
| }
|
| }
|
| - lib_sources_gypi = {
|
| - }
|
| - lib_sources_gypi =
|
| - exec_script("../../tools/gypi_to_gn.py",
|
| - [ rebase_path("../lib/${filename}_sources.gypi") ],
|
| - "scope",
|
| - [ "../lib/${filename}_sources.gypi" ])
|
| - libsources += rebase_path(lib_sources_gypi.sources, ".", "../lib")
|
| + libsources += rebase_path(processed_gypis["${filename}_runtime_sources"],
|
| + ".",
|
| + "../lib")
|
| liboutputs += [ "$target_gen_dir/${filename}_gen.cc" ]
|
| libdeps += [ ":generate_${filename}_cc_file" ]
|
| if (do_patch) {
|
| @@ -313,85 +296,75 @@ generate_core_libraries("core_libraries") {
|
| sources = [
|
| [
|
| "async",
|
| + "sdk",
|
| "async",
|
| true,
|
| - "../../sdk/lib/async",
|
| - "../lib",
|
| ],
|
| [
|
| "core",
|
| + "sdk",
|
| "core",
|
| true,
|
| - "../../sdk/lib/core",
|
| - "../lib",
|
| ],
|
| [
|
| "collection",
|
| + "sdk",
|
| "collection",
|
| true,
|
| - "../../sdk/lib/collection",
|
| - "../lib",
|
| ],
|
| [
|
| "convert",
|
| + "sdk",
|
| "convert",
|
| true,
|
| - "../../sdk/lib/convert",
|
| - "../lib",
|
| ],
|
| [
|
| "developer",
|
| + "sdk",
|
| "developer",
|
| true,
|
| - "../../sdk/lib/developer",
|
| - "../lib",
|
| ],
|
| [
|
| "_internal",
|
| + "sdk",
|
| "internal",
|
| true,
|
| - "../../sdk/lib/internal",
|
| - "../lib",
|
| ],
|
| [
|
| "isolate",
|
| + "sdk",
|
| "isolate",
|
| true,
|
| - "../../sdk/lib/isolate",
|
| - "../lib",
|
| ],
|
| [
|
| "math",
|
| + "sdk",
|
| "math",
|
| true,
|
| - "../../sdk/lib/math",
|
| - "../lib",
|
| ],
|
| [
|
| "mirrors",
|
| + "sdk",
|
| "mirrors",
|
| true,
|
| - "../../sdk/lib/mirrors",
|
| - "../lib",
|
| ],
|
| [
|
| "profiler",
|
| + "sdk",
|
| "profiler",
|
| false,
|
| - "../../sdk/lib/profiler",
|
| ],
|
| [
|
| "typed_data",
|
| + "runtime",
|
| "typed_data",
|
| false,
|
| - "../lib",
|
| ],
|
| [
|
| "_vmservice",
|
| + "sdk",
|
| "vmservice",
|
| true,
|
| - "../../sdk/lib/vmservice",
|
| - "../lib",
|
| ],
|
| ]
|
| }
|
| @@ -404,6 +377,7 @@ template("concatenate_patch") {
|
| process_library_source(target_name) {
|
| output = invoker.output
|
| path = "../${invoker.dir}"
|
| + type = "sdk"
|
| filename = invoker.libname
|
| script = "../tools/concatenate_patches.py"
|
| args = [
|
|
|