| # Copyright 2013 The Flutter 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("//flutter/common/config.gni") | |
| import("//flutter/testing/testing.gni") | |
| source_set("test_font") { | |
| sources = [ | |
| "test_font_data.cc", | |
| "test_font_data.h", | |
| ] | |
| deps = [ "//third_party/skia" ] | |
| public_configs = [ "//flutter:config" ] | |
| defines = [] | |
| if (flutter_runtime_mode == "debug" || current_toolchain == host_toolchain) { | |
| # Though the test font data is small, we dont want to add to the binary size | |
| # on the device (in profile and release modes). We only add the same on the | |
| # host test shells and the debug device shell. | |
| defines += [ "EMBED_TEST_FONT_DATA=1" ] | |
| } | |
| } | |
| # Picks the libdart implementation based on the Flutter runtime mode. | |
| group("libdart") { | |
| public_deps = [] | |
| if (flutter_runtime_mode == "profile" || flutter_runtime_mode == "release") { | |
| public_deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] | |
| } else { | |
| public_deps += [ | |
| "//flutter/lib/snapshot", | |
| "//third_party/dart/runtime:libdart_jit", | |
| ] | |
| } | |
| } | |
| source_set_maybe_fuchsia_legacy("runtime") { | |
| sources = [ | |
| "dart_isolate.cc", | |
| "dart_isolate.h", | |
| "dart_isolate_group_data.cc", | |
| "dart_isolate_group_data.h", | |
| "dart_service_isolate.cc", | |
| "dart_service_isolate.h", | |
| "dart_snapshot.cc", | |
| "dart_snapshot.h", | |
| "dart_vm.cc", | |
| "dart_vm.h", | |
| "dart_vm_data.cc", | |
| "dart_vm_data.h", | |
| "dart_vm_lifecycle.cc", | |
| "dart_vm_lifecycle.h", | |
| "embedder_resources.cc", | |
| "embedder_resources.h", | |
| "platform_data.cc", | |
| "platform_data.h", | |
| "ptrace_ios.cc", | |
| "ptrace_ios.h", | |
| "runtime_controller.cc", | |
| "runtime_controller.h", | |
| "runtime_delegate.cc", | |
| "runtime_delegate.h", | |
| "service_protocol.cc", | |
| "service_protocol.h", | |
| "skia_concurrent_executor.cc", | |
| "skia_concurrent_executor.h", | |
| ] | |
| public_deps = [ "//third_party/rapidjson" ] | |
| public_configs = [ "//flutter:config" ] | |
| deps = [ | |
| ":test_font", | |
| "//flutter/assets", | |
| "//flutter/common", | |
| "//flutter/fml", | |
| "//flutter/lib/io", | |
| "//flutter/third_party/tonic", | |
| "//flutter/third_party/txt", | |
| "//third_party/dart/runtime:dart_api", | |
| "//third_party/dart/runtime/bin:dart_io_api", | |
| "//third_party/skia", | |
| ] | |
| if (flutter_runtime_mode != "release" && !is_fuchsia) { | |
| # Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia | |
| # instead puts Observatory into the runner's package. | |
| deps += [ | |
| "//third_party/dart/runtime/observatory:embedded_observatory_archive", | |
| ] | |
| } | |
| deps_legacy_and_next = [ | |
| "//flutter/flow:flow", | |
| "//flutter/lib/ui:ui", | |
| ] | |
| } | |
| if (enable_unittests) { | |
| test_fixtures("runtime_fixtures") { | |
| dart_main = "fixtures/runtime_test.dart" | |
| } | |
| source_set_maybe_fuchsia_legacy("runtime_unittests_common") { | |
| testonly = true | |
| sources = [ | |
| "dart_isolate_unittests.cc", | |
| "dart_lifecycle_unittests.cc", | |
| "dart_service_isolate_unittests.cc", | |
| "dart_vm_unittests.cc", | |
| ] | |
| public_configs = [ "//flutter:export_dynamic_symbols" ] | |
| public_deps = [ | |
| ":libdart", | |
| ":runtime_fixtures", | |
| "//flutter/common", | |
| "//flutter/fml", | |
| "//flutter/lib/snapshot", | |
| "//flutter/testing", | |
| "//flutter/third_party/tonic", | |
| "//third_party/dart/runtime/bin:elf_loader", | |
| "//third_party/skia", | |
| ] | |
| deps_legacy_and_next = [ | |
| ":runtime", | |
| "//flutter/testing:dart", | |
| "//flutter/testing:fixture_test", | |
| ] | |
| } | |
| if (is_fuchsia) { | |
| executable("runtime_unittests") { | |
| testonly = true | |
| deps = [ ":runtime_unittests_common_fuchsia_legacy" ] | |
| } | |
| executable("runtime_unittests_next") { | |
| testonly = true | |
| deps = [ ":runtime_unittests_common" ] | |
| } | |
| } else { | |
| executable("runtime_unittests") { | |
| testonly = true | |
| deps = [ ":runtime_unittests_common" ] | |
| } | |
| } | |
| } |