Chromium Code Reviews| Index: runtime/bin/BUILD.gn |
| diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn |
| index d03757b35b211149706862d64f97c68e8a3a5536..71f330cd68c14d8a5c3ba29ac967aaac81c50e91 100644 |
| --- a/runtime/bin/BUILD.gn |
| +++ b/runtime/bin/BUILD.gn |
| @@ -2,6 +2,15 @@ |
| # 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. |
| +declare_args() { |
| + dart_io_include_root_certs = false |
| + |
| + dart_zlib_path = "//third_party/zlib" |
| + |
| + dart_include_observatory = false |
| +} |
| + |
| + |
| resources_sources_gypi = |
| exec_script("../../tools/gypi_to_gn.py", |
| [rebase_path("vmservice/vmservice_sources.gypi")], |
| @@ -45,12 +54,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) |
| } |
| } |
| @@ -99,10 +112,103 @@ gen_library_src_path("generate_io_patch_cc_file") { |
| } |
| +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 = [ |
| "dl", |
| ] |
| + if (is_android) { |
| + libs += [ |
| + "android", |
| + "log", |
| + ] |
| + } |
| } |
| @@ -119,6 +225,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 = [ |
| "..", |
| @@ -136,11 +253,44 @@ static_library("libdart_builtin") { |
| static_library("libdart_nosnapshot") { |
|
Cutch
2016/09/21 23:26:27
same comment here about a template to avoid the du
zra
2016/09/22 06:08:17
Done.
|
| configs += ["..:dart_config", |
| + "..:dart_product_config"] |
| + deps = [ |
| + "../vm:libdart_lib_nosnapshot", |
| + "../vm:libdart_vm_nosnapshot", |
| + "../vm:libdart_platform", |
| + "../third_party/double-conversion/src:libdouble_conversion", |
| + "..:generate_version_cc_file", |
| + ] |
| + |
| + sources = [ |
| + "../include/dart_api.h", |
| + "../include/dart_mirrors_api.h", |
| + "../include/dart_native_api.h", |
| + "../include/dart_tools_api.h", |
| + "../vm/dart_api_impl.cc", |
| + "../vm/debugger_api_impl.cc", |
| + "../vm/mirrors_api_impl.cc", |
| + "../vm/native_api_impl.cc", |
| + "$target_gen_dir/../version.cc", |
| + ] |
| + |
| + include_dirs = [ |
| + "..", |
| + ] |
| + |
| + defines = [ |
| + "DART_SHARED_LIB", |
| + ] |
| +} |
| + |
| + |
| +static_library("libdart_nosnapshot_precompiled_runtime") { |
| + configs += ["..:dart_config", |
| "..:dart_product_config", |
| "..:dart_precompiled_runtime_config"] |
| deps = [ |
| "../vm:libdart_lib_nosnapshot", |
| - "../vm:libdart_vm_nosnapshot", |
| + "../vm:libdart_vm_nosnapshot_precompiled_runtime", |
| "../vm:libdart_platform", |
| "../third_party/double-conversion/src:libdouble_conversion", |
| "..:generate_version_cc_file", |
| @@ -258,7 +408,7 @@ source_set("gen_snapshot_dart_io") { |
| "..:dart_precompiler_config"] |
| deps = [ |
| - "//third_party/zlib", |
| + "$dart_zlib_path", |
| ] |
| custom_sources_filter = [ |
| @@ -293,22 +443,20 @@ source_set("gen_snapshot_dart_io") { |
| source_set("libdart_embedder_noio") { |
| configs += ["..:dart_config", |
| - "..:dart_product_config", |
| - "..:dart_precompiled_runtime_config"] |
| + "..:dart_product_config"] |
| deps = [ |
| "..:libdart", |
| "../vm:libdart_platform", |
| ] |
| } |
| +# add argument set to false for including root_certificates.cc |
| -# A source set for the implementation of 'dart:io' library |
| -# (without secure sockets). |
| + |
| +# A source set for the implementation of 'dart:io' library. |
| source_set("embedded_dart_io") { |
| configs += ["..:dart_config", |
| - "..:dart_product_config", |
| - "..:dart_precompiled_runtime_config"] |
| - |
| + "..:dart_product_config"] |
| custom_sources_filter = [ |
| "*_test.cc", |
| "*_test.h", |
| @@ -324,6 +472,7 @@ source_set("embedded_dart_io") { |
| } |
| set_sources_assignment_filter(custom_sources_filter) |
| + defines = [] |
| if (is_mac || is_ios) { |
| libs = [ |
| "Security.framework", |
| @@ -352,8 +501,15 @@ source_set("embedded_dart_io") { |
| "log_win.cc", |
| "log.h", |
| ] |
| + |
| if (is_linux) { |
| - sources += [ "../../third_party/root_certificates/root_certificates.cc"] |
| + if (dart_io_include_root_certs) { |
| + sources += [ "../../third_party/root_certificates/root_certificates.cc"] |
| + } else { |
| + defines += [ |
| + "DART_IO_ROOT_CERTS_DISABLED", |
| + ] |
| + } |
| } |
| include_dirs = [ |
| @@ -437,6 +593,242 @@ source_set("dart_snapshot_cc") { |
| ] |
| } |
| + |
| +executable("dart") { |
| + configs += ["..:dart_config", |
| + "..:dart_product_config"] |
| + deps = [ |
| + ":gen_resources_cc", |
| + ":embedded_dart_io", |
| + ":libdart_builtin", |
| + "../vm:libdart_platform", |
| + "..:libdart", |
| + ":dart_snapshot_cc", |
| + "$dart_zlib_path", |
| + ] |
| + |
| + sources = [ |
| + "main.cc", |
| + "vmservice_impl.cc", |
| + "vmservice_impl.h", |
| + "$target_gen_dir/resources_gen.cc", |
| + ] |
| + |
| + if (!dart_include_observatory) { |
| + defines = [ |
| + "NO_OBSERVATORY", |
| + ] |
| + sources += [ |
| + "observatory_assets_empty.cc", |
| + ] |
| + } else { |
| + deps += [ |
| + "../observatory:standalone_observatory_archive", |
| + ] |
| + } |
| + |
| + include_dirs = [ |
| + "..", |
| + "//third_party", |
| + ] |
| + |
| + ldflags = [ |
| + "-rdynamic", |
| + ] |
| +} |
| + |
| +executable("dart_precompiled_runtime") { |
|
Cutch
2016/09/21 23:26:27
This is identical to the executable "dart' above.
zra
2016/09/22 06:08:17
Done.
|
| + configs += ["..:dart_config", |
| + "..:dart_product_config"] |
| + deps = [ |
| + ":gen_resources_cc", |
| + ":embedded_dart_io", |
| + ":libdart_builtin", |
| + "../vm:libdart_platform", |
| + "..:libdart", |
| + ":dart_snapshot_cc", |
| + "$dart_zlib_path", |
| + ] |
| + |
| + sources = [ |
| + "main.cc", |
| + "vmservice_impl.cc", |
| + "vmservice_impl.h", |
| + "$target_gen_dir/resources_gen.cc", |
| + ] |
| + |
| + if (!dart_include_observatory) { |
| + defines = [ |
| + "NO_OBSERVATORY", |
| + ] |
| + sources += [ |
| + "observatory_assets_empty.cc", |
| + ] |
| + } else { |
| + deps += [ |
| + "../observatory:standalone_observatory_archive", |
| + ] |
| + } |
| + |
| + include_dirs = [ |
| + "..", |
| + "//third_party", |
| + ] |
| + |
| + ldflags = [ |
| + "-rdynamic", |
| + ] |
| +} |
| + |
| +executable("dart_bootstrap") { |
| + configs += ["..:dart_config", |
| + "..:dart_product_config", |
| + "..:dart_precompiler_config", |
| + "..:dart_no_snapshot_config",] |
| + deps = [ |
| + ":gen_resources_cc", |
| + ":embedded_dart_io", |
| + ":libdart_builtin", |
| + "../vm:libdart_platform", |
| + "..:libdart", |
| + "$dart_zlib_path", |
| + ] |
| + |
| + 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", |
| + ] |
| + |
| + ldflags = [ |
| + "-rdynamic", |
| + ] |
| +} |
| + |
| +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"] |
| + deps = [ |
| + "..:libdart", |
| + ":libdart_builtin", |
| + ":embedded_dart_io", |
| + ":dart_snapshot_cc", |
| + ":generate_snapshot_test_dat_file", |
| + "../vm:libdart_platform", |
| + "$dart_zlib_path", |
| + ] |
| + 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 |
| + |
| + ldflags = [ |
| + "-rdynamic", |
| + ] |
| +} |
| + |
| + |
| +shared_library("test_extension") { |
| + deps = [ |
| + ":dart", |
| + ] |
| + sources = [ |
| + "test_extension.c", |
| + "test_extension_dllmain_win.cc", |
| + ] |
| + include_dirs = [ |
| + "..", |
| + ] |
| + defines = [ |
| + # The only effect of DART_SHARED_LIB is to export the Dart API. |
| + "DART_SHARED_LIB", |
| + ] |
| +} |
| + |
| + |
| +shared_library("sample_extension") { |
| + deps = [ |
| + ":dart", |
| + ] |
| + sources = [ |
| + "../../samples/sample_extension/sample_extension.cc", |
| + "../../samples/sample_extension/sample_extension_dllmain_win.cc", |
| + ] |
| + include_dirs = [ |
| + "..", |
| + ] |
| + defines = [ |
| + # The only effect of DART_SHARED_LIB is to export the Dart API. |
| + "DART_SHARED_LIB", |
| + ] |
| +} |
| + |
| + |
| if (defined(is_fuchsia) && is_fuchsia) { |
| copy("hello_fuchsia") { |
| sources = [ "../tests/vm/dart/hello_fuchsia_test.dart" ] |
| @@ -445,8 +837,7 @@ if (defined(is_fuchsia) && is_fuchsia) { |
| executable("dart_no_observatory") { |
| configs += ["..:dart_config", |
| - "..:dart_product_config", |
| - "..:dart_precompiled_runtime_config",] |
| + "..:dart_product_config"] |
| deps = [ |
| ":hello_fuchsia", |
| ":gen_resources_cc", |
| @@ -455,7 +846,7 @@ if (defined(is_fuchsia) && is_fuchsia) { |
| "../vm:libdart_platform", |
| "..:libdart", |
| ":dart_snapshot_cc", |
| - "//third_party/zlib", |
| + "$dart_zlib_path", |
| ] |
| defines = [ |
| @@ -476,77 +867,6 @@ if (defined(is_fuchsia) && is_fuchsia) { |
| ] |
| } |
| - 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") { |
| - testonly = true |
| - 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 |
| - } |
| - |
| executable("run_vm_tests_fuchsia") { |
| testonly = true |
| configs += ["..:dart_config"] |