Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: runtime/bin/BUILD.gn

Issue 2023703002: Beginning work on GN build (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Really add //build. Add dart_bootstrap rule. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/BUILD.gn ('k') | runtime/bin/bin.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/BUILD.gn
diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn
index bff1387bb54f433cbaa90227fa1be7f04818c298..0cfdb81e3806c3c02c8a946932d4b742cda73293 100644
--- a/runtime/bin/BUILD.gn
+++ b/runtime/bin/BUILD.gn
@@ -26,7 +26,7 @@ action("gen_resources_cc") {
# the Dart runtime to gn, this path might need to be updated.
sources = rebase_path(resources_sources_gypi.sources,
"",
- "//dart/runtime/bin/vmservice/")
+ "../bin/vmservice/")
outputs = [ "$target_gen_dir/resources_gen.cc" ]
args = [
"--output",
@@ -52,12 +52,16 @@ template("gen_library_src_path") {
outputs = [ invoker.output, ]
name = invoker.name
kind = invoker.kind
+ library_name = "dart:${name}"
+ if (defined(invoker.library_name)) {
+ library_name = invoker.library_name
+ }
args = [
"--output", rebase_path(invoker.output, root_build_dir),
"--input_cc", rebase_path("builtin_in.cc", root_build_dir),
"--include", "bin/builtin.h",
"--var_name", "dart::bin::Builtin::${name}_${kind}_paths_",
- "--library_name", "dart:${name}",] +
+ "--library_name", library_name,] +
rebase_path(invoker.sources, root_build_dir)
}
}
@@ -105,6 +109,92 @@ gen_library_src_path("generate_io_patch_cc_file") {
output = "$target_gen_dir/io_patch_gen.cc"
}
+gen_library_src_path("generate_html_cc_file") {
+ name = "html"
+ kind = "source"
+ sources = ["../../sdk/lib/html/dartium/html_dartium.dart"]
+ output = "$target_gen_dir/html_gen.cc"
+}
+
+gen_library_src_path("generate_html_common_cc_file") {
+ name = "html_common"
+ kind = "source"
+ sources = [
+ "../../sdk/lib/html/html_common/html_common.dart",
+ "../../sdk/lib/html/html_common/css_class_set.dart",
+ "../../sdk/lib/html/html_common/device.dart",
+ "../../sdk/lib/html/html_common/filtered_element_list.dart",
+ "../../sdk/lib/html/html_common/lists.dart",
+ "../../sdk/lib/html/html_common/conversions.dart",
+ "../../sdk/lib/html/html_common/conversions_dartium.dart",
+ ]
+ output = "$target_gen_dir/html_common_gen.cc"
+}
+
+gen_library_src_path("generate_js_cc_file") {
+ name = "js"
+ kind = "source"
+ sources = ["../../sdk/lib/js/dartium/js_dartium.dart"]
+ output = "$target_gen_dir/js_gen.cc"
+}
+
+gen_library_src_path("generate_blink_cc_file") {
+ name = "_blink"
+ kind = "source"
+ sources = ["../../sdk/lib/_blink/dartium/_blink_dartium.dart"]
+ output = "$target_gen_dir/blink_gen.cc"
+}
+
+gen_library_src_path("generate_indexed_db_cc_file") {
+ name = "indexed_db"
+ kind = "source"
+ sources = ["../../sdk/lib/indexed_db/dartium/indexed_db_dartium.dart"]
+ output = "$target_gen_dir/indexed_db_gen.cc"
+}
+
+gen_library_src_path("generate_cached_patches_cc_file") {
+ name = "cached_patches"
+ library_name = "cached_patches.dart"
+ kind = "sources"
+ sources = ["../../sdk/lib/js/dartium/cached_patches.dart"]
+ output = "$target_gen_dir/cached_patches_gen.cc"
+}
+
+gen_library_src_path("generate_web_gl_cc_file") {
+ name = "web_gl"
+ kind = "source"
+ sources = ["../../sdk/lib/web_gl/dartium/web_gl_dartium.dart"]
+ output = "$target_gen_dir/web_gl_gen.cc"
+}
+
+gen_library_src_path("generate_metadata_cc_file") {
+ name = "metadata"
+ library_name = "metadata.dart"
+ kind = "source"
+ sources = ["../../sdk/lib/html/html_common/metadata.dart"]
+ output = "$target_gen_dir/metadata_gen.cc"
+}
+
+gen_library_src_path("generate_web_sql_cc_file") {
+ name = "web_sql"
+ kind = "source"
+ sources = ["../../sdk/lib/web_sql/dartium/web_sql_dartium.dart"]
+ output = "$target_gen_dir/web_sql_gen.cc"
+}
+
+gen_library_src_path("generate_svg_cc_file") {
+ name = "svg"
+ kind = "source"
+ sources = ["../../sdk/lib/svg/dartium/svg_dartium.dart"]
+ output = "$target_gen_dir/svg_gen.cc"
+}
+
+gen_library_src_path("generate_web_audio_cc_file") {
+ name = "web_audio"
+ kind = "source"
+ sources = ["../../sdk/lib/web_audio/dartium/web_audio_dartium.dart"]
+ output = "$target_gen_dir/web_audio_gen.cc"
+}
config("libdart_builtin_config") {
libs = [
@@ -126,6 +216,17 @@ static_library("libdart_builtin") {
":generate_builtin_cc_file",
":generate_io_cc_file",
":generate_io_patch_cc_file",
+ ":generate_html_cc_file",
+ ":generate_html_common_cc_file",
+ ":generate_js_cc_file",
+ ":generate_blink_cc_file",
+ ":generate_indexed_db_cc_file",
+ ":generate_cached_patches_cc_file",
+ ":generate_web_gl_cc_file",
+ ":generate_metadata_cc_file",
+ ":generate_web_sql_cc_file",
+ ":generate_svg_cc_file",
+ ":generate_web_audio_cc_file",
]
include_dirs = [
"..",
@@ -303,6 +404,7 @@ source_set("gen_snapshot_dart_io") {
]
}
+
# A source set for the implementation of 'dart:io' library
# (without secure sockets).
source_set("embedded_dart_io") {
@@ -355,3 +457,222 @@ source_set("embedded_dart_io") {
"//third_party"
]
}
+
+
+action("generate_snapshot_bin") {
+ deps = [
+ "../bin:gen_snapshot($host_toolchain)",
+ ]
+
+ vm_isolate_snapshot = "$target_gen_dir/vm_isolate_snapshot.bin"
+ isolate_snapshot = "$target_gen_dir/isolate_snapshot.bin"
+ gen_snapshot_stamp_file = "$target_gen_dir/gen_snapshot.stamp"
+ outputs = [
+ vm_isolate_snapshot,
+ isolate_snapshot,
+ gen_snapshot_stamp_file,
+ ]
+
+ gen_snapshot_dir =
+ get_label_info("../bin:gen_snapshot($host_toolchain)", "root_out_dir")
+
+ script = rebase_path("../tools/create_snapshot_bin.py")
+ args = [
+ "--executable",
+ rebase_path("$gen_snapshot_dir/gen_snapshot"),
+ "--vm_output_bin",
+ rebase_path(vm_isolate_snapshot, root_build_dir),
+ "--output_bin",
+ rebase_path(isolate_snapshot, root_build_dir),
+ "--target_os",
+ current_os,
+ "--timestamp_file",
+ rebase_path(gen_snapshot_stamp_file, root_build_dir),
+ ]
+}
+
+
+action("generate_snapshot_file") {
+ deps = [
+ ":generate_snapshot_bin",
+ ]
+
+ snapshot_in_cc_file = "snapshot_in.cc"
+ inputs = [
+ "../tools/create_snapshot_file.py",
+ snapshot_in_cc_file,
+ "$target_gen_dir/vm_isolate_snapshot.bin",
+ "$target_gen_dir/isolate_snapshot.bin",
+ ]
+ output = "$root_gen_dir/dart_snapshot.cc"
+ outputs = [
+ output,
+ ]
+
+ script = "../tools/create_snapshot_file.py"
+ args = [
+ "--vm_input_bin",
+ rebase_path("$target_gen_dir/vm_isolate_snapshot.bin"),
+ "--input_bin",
+ rebase_path("$target_gen_dir/isolate_snapshot.bin"),
+ "--input_cc",
+ rebase_path(snapshot_in_cc_file),
+ "--output",
+ rebase_path(output),
+ ]
+}
+
+
+source_set("dart_snapshot_cc") {
+ sources = [
+ "$root_gen_dir/dart_snapshot.cc",
+ ]
+
+ deps = [
+ ":generate_snapshot_file",
+ ]
+}
+
+
+executable("dart") {
+ configs += ["..:dart_config",
+ "..:dart_product_config",
+ "..:dart_precompiled_runtime_config",]
+ deps = [
+ ":gen_resources_cc",
+ ":embedded_dart_io",
+ # ":generate_builtin_cc_file",
+ # ":generate_io_cc_file",
+ # ":generate_io_patch_cc_file",
+ ":libdart_builtin",
+ "../vm:libdart_platform",
+ "..:libdart",
+ "../observatory:standalone_observatory_archive",
+ ":dart_snapshot_cc",
+ "//third_party/zlib",
+ ]
+
+ sources = [
+ "main.cc",
+ "vmservice_impl.cc",
+ "vmservice_impl.h",
+ "$target_gen_dir/resources_gen.cc",
+ ]
+
+ include_dirs = [
+ "..",
+ "//third_party",
+ ]
+}
+
+
+executable("dart_bootstrap") {
+ configs += ["..:dart_config",
+ "..:dart_product_config",
+ "..:dart_precompiler_config",
+ "..:dart_no_snapshot_config",]
+ deps = [
+ ":gen_resources_cc",
+ ":embedded_dart_io",
+ # ":generate_builtin_cc_file",
+ # ":generate_io_cc_file",
+ # ":generate_io_patch_cc_file",
+ ":libdart_builtin",
+ "../vm:libdart_platform",
+ "..:libdart",
+ "//third_party/zlib",
+ ]
+
+ sources = [
+ "main.cc",
+ "vmservice_impl.cc",
+ "vmservice_impl.h",
+ "observatory_assets_empty.cc",
+ "snapshot_empty.cc",
+ "$target_gen_dir/resources_gen.cc",
+ ]
+
+ include_dirs = [
+ "..",
+ "//third_party",
+ ]
+}
+
+
+executable("process_test") {
+ sources = [
+ "process_test.cc",
+ ]
+}
+
+
+action("generate_snapshot_test_dat_file") {
+ snapshot_test_dat_file = "$root_gen_dir/snapshot_test.dat"
+ snapshot_test_in_dat_file = "../vm/snapshot_test_in.dat"
+ snapshot_test_dart_file = "../vm/snapshot_test.dart"
+ inputs = [
+ "../tools/create_string_literal.py",
+ snapshot_test_in_dat_file,
+ snapshot_test_dart_file,
+ ]
+
+ outputs = [
+ snapshot_test_dat_file,
+ ]
+
+ script = "../tools/create_string_literal.py"
+ args = [
+ "--output",
+ rebase_path(snapshot_test_dat_file),
+ "--input_cc",
+ rebase_path(snapshot_test_in_dat_file),
+ "--include",
+ "INTENTIONALLY_LEFT_BLANK",
+ "--var_name",
+ "INTENTIONALLY_LEFT_BLANK_TOO",
+ rebase_path(snapshot_test_dart_file),
+ ]
+}
+
+
+executable("run_vm_tests") {
+ configs += ["..:dart_config",
+ "..:dart_product_config",
+ "..:dart_precompiled_runtime_config",]
+ deps = [
+ "..:libdart",
+ ":libdart_builtin",
+ ":embedded_dart_io",
+ ":dart_snapshot_cc",
+ ":generate_snapshot_test_dat_file",
+ "../vm:libdart_platform",
+ "//third_party/zlib",
+ ]
+ include_dirs = [
+ "..",
+ "$target_gen_dir",
+ ]
+ defines = [
+ "TESTING",
+ ]
+
+ vm_tests_list = exec_script("../../tools/gypi_to_gn.py",
+ [rebase_path("../vm/vm_sources.gypi"),
+ "--keep_only=_test.cc",
+ "--keep_only=_test.h",],
+ "scope",
+ ["../vm/vm_sources.gypi"])
+ vm_tests = rebase_path(vm_tests_list.sources, ".", "../vm")
+
+ builtin_impl_tests_list =
+ exec_script("../../tools/gypi_to_gn.py",
+ [rebase_path("builtin_impl_sources.gypi"),
+ "--keep_only=_test.cc",
+ "--keep_only=_test.h",],
+ "scope",
+ ["builtin_impl_sources.gypi"])
+
+ sources = [
+ "run_vm_tests.cc",
+ ] + builtin_impl_tests_list.sources + vm_tests
+}
« no previous file with comments | « runtime/BUILD.gn ('k') | runtime/bin/bin.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698