| # Copyright 2014 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//mojo/public/mojo_application.gni") |
| |
| group("dart") { |
| deps = [ |
| ":dart_content_handler", |
| ] |
| } |
| |
| action("generate_snapshot_bin") { |
| deps = [ |
| "//dart/runtime/bin:gen_snapshot($host_toolchain)", |
| ] |
| inputs = [ |
| "snapshot.dart", |
| "//dart/runtime/tools/create_snapshot_bin.py", |
| "//mojo/dart/embedder/builtin.dart", |
| "//mojo/public/dart/internal.dart", |
| "//mojo/public/dart/src/handle_watcher.dart", |
| "//mojo/public/dart/src/natives.dart", |
| "//mojo/public/dart/src/timer_queue.dart", |
| ] |
| vm_isolate_snapshot = "$target_gen_dir/vm_isolate_snapshot.bin" |
| isolate_snapshot = "$target_gen_dir/isolate_snapshot.bin" |
| outputs = [ |
| vm_isolate_snapshot, |
| isolate_snapshot, |
| ] |
| |
| gen_snapshot_dir = |
| get_label_info("//dart/runtime/bin:gen_snapshot($host_toolchain)", |
| "root_out_dir") |
| script = "//dart/runtime/tools/create_snapshot_bin.py" |
| builtin_path = rebase_path("//mojo/dart/embedder/builtin.dart") |
| internal_path = rebase_path("//mojo/public/dart/internal.dart") |
| args = [ |
| "--executable", |
| rebase_path("$gen_snapshot_dir/gen_snapshot"), |
| "--package_root", |
| rebase_path("$root_gen_dir"), |
| "--script", |
| rebase_path("snapshot.dart"), |
| "--vm_output_bin", |
| rebase_path(vm_isolate_snapshot, root_build_dir), |
| "--output_bin", |
| rebase_path(isolate_snapshot, root_build_dir), |
| "--target_os", |
| os, |
| "--url_mapping=dart:mojo.builtin,$builtin_path", |
| "--url_mapping=dart:mojo.internal,$internal_path", |
| ] |
| } |
| |
| action("generate_snapshot_file") { |
| deps = [ |
| ":generate_snapshot_bin", |
| ] |
| inputs = [ |
| "//dart/runtime/tools/create_snapshot_file.py", |
| "//mojo/dart/embedder/snapshot.cc.tmpl", |
| "$target_gen_dir/vm_isolate_snapshot.bin", |
| "$target_gen_dir/isolate_snapshot.bin", |
| ] |
| output = "$target_gen_dir/snapshot.cc" |
| outputs = [ |
| output, |
| ] |
| |
| script = "//dart/runtime/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("//mojo/dart/embedder/snapshot.cc.tmpl"), |
| "--output", |
| rebase_path(output), |
| ] |
| } |
| |
| source_set("dart_controller") { |
| sources = [ |
| "$target_gen_dir/snapshot.cc", |
| ] |
| |
| deps = [ |
| ":generate_snapshot_file", |
| "//mojo/dart/embedder:dart_controller_no_snapshot", |
| ] |
| } |
| |
| mojo_native_application("dart_content_handler") { |
| sources = [ |
| "content_handler_main.cc", |
| "dart_app.cc", |
| "dart_app.h", |
| ] |
| |
| deps = [ |
| ":dart_controller", |
| "//base", |
| "//base:i18n", |
| "//crypto", |
| "//dart/runtime:libdart", |
| "//mojo/application", |
| "//mojo/application:application", |
| "//mojo/application:content_handler", |
| "//mojo/dart/embedder:dart_controller_no_snapshot", |
| "//mojo/common", |
| "//mojo/environment:chromium", |
| "//mojo/icu", |
| "//mojo/public/cpp/system", |
| "//mojo/public/cpp/utility", |
| "//mojo/public/interfaces/application", |
| "//mojo/services/content_handler/public/interfaces", |
| "//mojo/services/network/public/interfaces", |
| "//third_party/zlib:zip", |
| "//url:url", |
| ] |
| } |