| # 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/shell/platform/config.gni") |
| |
| if (is_fuchsia) { |
| import("//build/fuchsia/sdk.gni") |
| } |
| |
| # Whether to build the dartdevc sdk, libraries, and source files |
| # required for the flutter web sdk. |
| declare_args() { |
| full_dart_sdk = false |
| } |
| |
| group("flutter") { |
| testonly = true |
| |
| public_deps = [] |
| |
| if (!is_fuchsia) { |
| public_deps += [ |
| "//flutter/lib/snapshot:generate_snapshot_bin", |
| "//flutter/lib/snapshot:kernel_platform_files", |
| ] |
| } |
| |
| public_deps += [ |
| "//flutter/shell/platform/embedder:flutter_engine", |
| "//flutter/sky", |
| ] |
| |
| if (current_toolchain == host_toolchain) { |
| public_deps += [ "//flutter/tools/font-subset" ] |
| } |
| |
| if (current_toolchain == host_toolchain) { |
| public_deps += [ "//flutter/shell/testing" ] |
| public_deps += [ "//flutter/tools/const_finder" ] |
| } |
| |
| if (is_fuchsia) { |
| public_deps += [ |
| "//flutter/shell/platform/fuchsia", |
| "//flutter/shell/testing($host_toolchain)", |
| ] |
| } |
| |
| if (!is_fuchsia) { |
| if (current_toolchain == host_toolchain) { |
| public_deps += [ |
| "//flutter/flutter_frontend_server:frontend_server", |
| "//third_party/dart:create_sdk", |
| ] |
| |
| if (full_dart_sdk) { |
| public_deps += [ "//flutter/web_sdk" ] |
| } |
| } |
| } |
| |
| # If on the host, compile all unittests targets. |
| if (current_toolchain == host_toolchain) { |
| if (is_mac) { |
| public_deps += |
| [ "//flutter/shell/platform/darwin:flutter_channels_unittests" ] |
| } |
| |
| public_deps += [ |
| "//flutter/flow:flow_unittests", |
| "//flutter/fml:fml_unittests", |
| "//flutter/lib/ui:ui_unittests", |
| "//flutter/runtime:runtime_unittests", |
| "//flutter/shell/common:shell_unittests", |
| "//flutter/shell/platform/embedder:embedder_unittests", |
| "//flutter/testing:testing_unittests", |
| "//flutter/third_party/txt:txt_unittests", |
| ] |
| |
| if (!is_win) { |
| public_deps += [ |
| "//flutter/fml:fml_benchmarks", |
| "//flutter/lib/ui:ui_benchmarks", |
| "//flutter/shell/common:shell_benchmarks", |
| "//flutter/shell/platform/android/external_view_embedder:android_external_view_embedder_unittests", |
| "//flutter/shell/platform/android/jni:jni_unittests", |
| "//flutter/third_party/txt:txt_benchmarks", |
| ] |
| } |
| |
| # Unit tests for desktop embeddings should only be built if the desktop |
| # embeddings are being built. |
| if (enable_desktop_embeddings) { |
| public_deps += [ |
| "//flutter/shell/platform/common/cpp:common_cpp_core_unittests", |
| "//flutter/shell/platform/common/cpp:common_cpp_unittests", |
| "//flutter/shell/platform/common/cpp/client_wrapper:client_wrapper_unittests", |
| "//flutter/shell/platform/glfw/client_wrapper:client_wrapper_glfw_unittests", |
| ] |
| if (is_mac) { |
| public_deps += [ "//flutter/shell/platform/darwin/macos:flutter_desktop_darwin_unittests" ] |
| } |
| if (is_win) { |
| public_deps += [ |
| "//flutter/shell/platform/windows:flutter_windows_unittests", |
| "//flutter/shell/platform/windows/client_wrapper:client_wrapper_windows_unittests", |
| ] |
| } |
| if (is_linux) { |
| public_deps += |
| [ "//flutter/shell/platform/linux:flutter_linux_unittests" ] |
| } |
| } |
| } |
| } |
| |
| config("config") { |
| include_dirs = [ ".." ] |
| if (is_win) { |
| if (current_cpu != "x86") { |
| cflags = [ "/WX" ] # Treat warnings as errors. |
| } |
| } |
| } |
| |
| # This "fuchsia_legacy" configuration includes old, non-embedder API sources and |
| # defines the LEGACY_FUCHSIA_EMBEDDER symbol. This config and its associated |
| # template are both transitional and will be removed after the embedder API |
| # transition is complete. |
| # |
| # See `source_set_maybe_fuchsia_legacy` in //flutter/common/config.gni |
| # |
| # TODO(fxb/54041): Remove when no longer neccesary. |
| config("fuchsia_legacy") { |
| if (is_fuchsia) { |
| defines = [ "LEGACY_FUCHSIA_EMBEDDER" ] |
| } |
| } |
| |
| config("export_dynamic_symbols") { |
| if (is_linux || is_fuchsia) { |
| inputs = [ |
| "//flutter/common/exported_symbols.sym", |
| ] |
| ldflags = [ "-Wl,--dynamic-list=" + rebase_path(inputs[0], root_build_dir) ] |
| } |
| } |
| |
| group("dist") { |
| testonly = true |
| |
| deps = [ |
| "//flutter/sky/dist", |
| ] |
| } |
| |
| # Fuchsia currently only supports a subset of our unit tests |
| # When adding a new dep here, please also ensure the dep is added to |
| # testing/fuchsia/run_tests.sh and testing/fuchsia/test_fars |
| if (is_fuchsia) { |
| group("fuchsia_tests") { |
| testonly = true |
| |
| deps = [ |
| "//flutter/flow:flow_tests", |
| "//flutter/flow:flow_tests_next", |
| "//flutter/fml:fml_tests", |
| "//flutter/runtime:runtime_tests", |
| "//flutter/runtime:runtime_tests_next", |
| "//flutter/shell/common:shell_tests", |
| "//flutter/shell/common:shell_tests_next", |
| "//flutter/shell/platform/fuchsia/flutter:flutter_runner_scenic_tests", |
| "//flutter/shell/platform/fuchsia/flutter:flutter_runner_tests", |
| ] |
| } |
| } |