未验证 提交 de15313b 编写于 作者: D David Worsham 提交者: GitHub

Dedupe sources for fuchsia shell/tests (#20343)

Remove the gni file, as it is confusing things
上级 b28b1dfe
...@@ -12,7 +12,6 @@ import("//flutter/tools/fuchsia/dart.gni") ...@@ -12,7 +12,6 @@ import("//flutter/tools/fuchsia/dart.gni")
import("//flutter/tools/fuchsia/fuchsia_archive.gni") import("//flutter/tools/fuchsia/fuchsia_archive.gni")
import("//flutter/tools/fuchsia/fuchsia_libs.gni") import("//flutter/tools/fuchsia/fuchsia_libs.gni")
import("//flutter/vulkan/config.gni") import("//flutter/vulkan/config.gni")
import("engine_flutter_runner.gni")
# Fuchsia uses its own custom Surface implementation. # Fuchsia uses its own custom Surface implementation.
shell_gpu_configuration("fuchsia_legacy_gpu_configuration") { shell_gpu_configuration("fuchsia_legacy_gpu_configuration") {
...@@ -22,10 +21,158 @@ shell_gpu_configuration("fuchsia_legacy_gpu_configuration") { ...@@ -22,10 +21,158 @@ shell_gpu_configuration("fuchsia_legacy_gpu_configuration") {
enable_metal = false enable_metal = false
} }
source_set("flutter_runner_sources") {
sources = [
"accessibility_bridge.cc",
"accessibility_bridge.h",
"component.cc",
"component.h",
"compositor_context.cc",
"compositor_context.h",
"engine.cc",
"engine.h",
"flutter_runner_product_configuration.cc",
"flutter_runner_product_configuration.h",
"fuchsia_intl.cc",
"fuchsia_intl.h",
"isolate_configurator.cc",
"isolate_configurator.h",
"logging.h",
"loop.cc",
"loop.h",
"platform_view.cc",
"platform_view.h",
"runner.cc",
"runner.h",
"session_connection.cc",
"session_connection.h",
"surface.cc",
"surface.h",
"task_observers.cc",
"task_observers.h",
"task_runner_adapter.cc",
"task_runner_adapter.h",
"thread.cc",
"thread.h",
"unique_fdio_ns.h",
"vsync_recorder.cc",
"vsync_recorder.h",
"vsync_waiter.cc",
"vsync_waiter.h",
"vulkan_surface.cc",
"vulkan_surface.h",
"vulkan_surface_pool.cc",
"vulkan_surface_pool.h",
"vulkan_surface_producer.cc",
"vulkan_surface_producer.h",
]
# The use of these dependencies is temporary and will be moved behind the
# embedder API.
flutter_public_deps = [
"//flutter/flow:flow_fuchsia_legacy",
"//flutter/lib/ui:ui_fuchsia_legacy",
"//flutter/runtime:runtime_fuchsia_legacy",
"//flutter/shell/common:common_fuchsia_legacy",
]
flutter_deps = [
":fuchsia_legacy_gpu_configuration",
"//flutter/assets",
"//flutter/common",
"//flutter/fml",
"//flutter/vulkan",
]
public_deps = [
"$fuchsia_sdk_root/pkg:scenic_cpp",
"$fuchsia_sdk_root/pkg:sys_cpp",
"//flutter/shell/platform/fuchsia/runtime/dart/utils",
] + flutter_public_deps
deps = [
"$fuchsia_sdk_root/fidl:fuchsia.accessibility.semantics",
"$fuchsia_sdk_root/fidl:fuchsia.fonts",
"$fuchsia_sdk_root/fidl:fuchsia.images",
"$fuchsia_sdk_root/fidl:fuchsia.intl",
"$fuchsia_sdk_root/fidl:fuchsia.io",
"$fuchsia_sdk_root/fidl:fuchsia.sys",
"$fuchsia_sdk_root/fidl:fuchsia.ui.app",
"$fuchsia_sdk_root/fidl:fuchsia.ui.scenic",
"$fuchsia_sdk_root/pkg:async-cpp",
"$fuchsia_sdk_root/pkg:async-default",
"$fuchsia_sdk_root/pkg:async-loop",
"$fuchsia_sdk_root/pkg:async-loop-cpp",
"$fuchsia_sdk_root/pkg:fdio",
"$fuchsia_sdk_root/pkg:fidl_cpp",
"$fuchsia_sdk_root/pkg:syslog",
"$fuchsia_sdk_root/pkg:trace",
"$fuchsia_sdk_root/pkg:trace-engine",
"$fuchsia_sdk_root/pkg:trace-provider-so",
"$fuchsia_sdk_root/pkg:vfs_cpp",
"$fuchsia_sdk_root/pkg:zx",
"//flutter/shell/platform/fuchsia/dart-pkg/fuchsia",
"//flutter/shell/platform/fuchsia/dart-pkg/zircon",
] + flutter_deps
}
# Things that explicitly being excluded: # Things that explicitly being excluded:
# 1. Kernel snapshot framework mode. # 1. Kernel snapshot framework mode.
# 2. Profiler symbols. # 2. Profiler symbols.
# Builds a flutter_runner
#
# Parameters:
#
# output_name (required):
# The name of the resulting binary.
#
# extra_deps (required):
# Any additional dependencies.
#
# product (required):
# Whether to link against a Product mode Dart VM.
#
# extra_defines (optional):
# Any additional preprocessor defines.
template("flutter_runner") {
assert(defined(invoker.output_name), "flutter_runner must define output_name")
assert(defined(invoker.extra_deps), "flutter_runner must define extra_deps")
assert(defined(invoker.product), "flutter_runner must define product")
invoker_output_name = invoker.output_name
extra_deps = invoker.extra_deps
extra_defines = []
if (defined(invoker.extra_defines)) {
extra_defines += invoker.extra_defines
}
executable(target_name) {
output_name = invoker_output_name
defines = extra_defines
sources = [ "main.cc" ]
deps = [
":flutter_runner_sources",
"$fuchsia_sdk_root/pkg:async-loop-cpp",
"$fuchsia_sdk_root/pkg:trace",
"$fuchsia_sdk_root/pkg:trace-provider-so",
] + extra_deps
# The flags below are needed so that Dart's CPU profiler can walk the
# C++ stack.
cflags = [ "-fno-omit-frame-pointer" ]
if (!invoker.product) {
# This flag is needed so that the call to dladdr() in Dart's native symbol
# resolver can report good symbol information for the CPU profiler.
ldflags = [ "-rdynamic" ]
}
}
}
flutter_runner("jit") { flutter_runner("jit") {
output_name = "flutter_jit_runner" output_name = "flutter_jit_runner"
product = false product = false
...@@ -267,66 +414,36 @@ executable("flutter_runner_unittests") { ...@@ -267,66 +414,36 @@ executable("flutter_runner_unittests") {
output_name = "flutter_runner_tests" output_name = "flutter_runner_tests"
sources = [ sources = [
"accessibility_bridge.cc",
"accessibility_bridge.h",
"accessibility_bridge_unittest.cc", "accessibility_bridge_unittest.cc",
"component.cc",
"component.h",
"component_unittest.cc", "component_unittest.cc",
"flutter_runner_fakes.h", "flutter_runner_fakes.h",
"flutter_runner_product_configuration.cc",
"flutter_runner_product_configuration.h",
"fuchsia_intl.cc",
"fuchsia_intl.h",
"fuchsia_intl_unittest.cc", "fuchsia_intl_unittest.cc",
"logging.h",
"loop.cc",
"loop.h",
"platform_view.cc",
"platform_view.h",
"platform_view_unittest.cc", "platform_view_unittest.cc",
"runner.cc",
"runner.h",
"runner_unittest.cc", "runner_unittest.cc",
"surface.cc",
"surface.h",
"task_observers.cc",
"task_observers.h",
"task_runner_adapter.cc",
"task_runner_adapter.h",
"tests/flutter_runner_product_configuration_unittests.cc", "tests/flutter_runner_product_configuration_unittests.cc",
"tests/vsync_recorder_unittests.cc", "tests/vsync_recorder_unittests.cc",
"thread.cc",
"thread.h",
"vsync_recorder.cc",
"vsync_recorder.h",
"vsync_waiter.cc",
"vsync_waiter.h",
"vsync_waiter_unittests.cc", "vsync_waiter_unittests.cc",
] ]
# This is needed for //third_party/googletest for linking zircon symbols. # This is needed for //third_party/googletest for linking zircon symbols.
libs = [ "//fuchsia/sdk/$host_os/arch/$target_cpu/sysroot/lib/libzircon.so" ] libs = [ "//fuchsia/sdk/$host_os/arch/$target_cpu/sysroot/lib/libzircon.so" ]
deps = [ # The use of these dependencies is temporary and will be moved behind the
":aot", # embedder API.
":flutter_runner_fixtures", flutter_deps = [
"//build/fuchsia/fidl:fuchsia.accessibility.semantics",
"//build/fuchsia/pkg:async-default",
"//build/fuchsia/pkg:async-loop-cpp",
"//build/fuchsia/pkg:async-loop-default",
"//build/fuchsia/pkg:scenic_cpp",
"//build/fuchsia/pkg:sys_cpp_testing",
"//flutter/common",
"//flutter/flow:flow_fuchsia_legacy", "//flutter/flow:flow_fuchsia_legacy",
"//flutter/lib/ui:ui_fuchsia_legacy", "//flutter/lib/ui:ui_fuchsia_legacy",
"//flutter/runtime:runtime_fuchsia_legacy",
"//flutter/shell/common:common_fuchsia_legacy", "//flutter/shell/common:common_fuchsia_legacy",
"//flutter/shell/platform/fuchsia/runtime/dart/utils",
"//flutter/testing",
"//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime:libdart_jit",
"//third_party/dart/runtime/platform:libdart_platform_jit", "//third_party/dart/runtime/platform:libdart_platform_jit",
] ]
deps = [
":flutter_runner_fixtures",
":flutter_runner_sources",
"//build/fuchsia/pkg:sys_cpp_testing",
"//flutter/testing",
] + flutter_deps
} }
executable("flutter_runner_tzdata_unittests") { executable("flutter_runner_tzdata_unittests") {
...@@ -334,34 +451,24 @@ executable("flutter_runner_tzdata_unittests") { ...@@ -334,34 +451,24 @@ executable("flutter_runner_tzdata_unittests") {
output_name = "flutter_runner_tzdata_tests" output_name = "flutter_runner_tzdata_tests"
sources = [ sources = [ "runner_tzdata_unittest.cc" ]
"runner.cc",
"runner.h",
"runner_tzdata_unittest.cc",
]
# This is needed for //third_party/googletest for linking zircon symbols. # This is needed for //third_party/googletest for linking zircon symbols.
libs = [ "//fuchsia/sdk/$host_os/arch/$target_cpu/sysroot/lib/libzircon.so" ] libs = [ "//fuchsia/sdk/$host_os/arch/$target_cpu/sysroot/lib/libzircon.so" ]
deps = [ # The use of these dependencies is temporary and will be moved behind the
":aot", # embedder API.
":flutter_runner_fixtures", flutter_deps = [
"//build/fuchsia/fidl:fuchsia.accessibility.semantics",
"//build/fuchsia/pkg:async-loop-cpp",
"//build/fuchsia/pkg:async-loop-default",
"//build/fuchsia/pkg:scenic_cpp",
"//build/fuchsia/pkg:sys_cpp_testing",
"//flutter/flow:flow_fuchsia_legacy",
"//flutter/lib/ui:ui_fuchsia_legacy", "//flutter/lib/ui:ui_fuchsia_legacy",
"//flutter/runtime:runtime_fuchsia_legacy",
"//flutter/shell/common:common_fuchsia_legacy",
"//flutter/shell/platform/fuchsia/runtime/dart/utils",
"//flutter/testing",
"//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime:libdart_jit",
"//third_party/dart/runtime/platform:libdart_platform_jit", "//third_party/dart/runtime/platform:libdart_platform_jit",
"//third_party/icu",
"//third_party/skia",
] ]
deps = [
":flutter_runner_fixtures",
":flutter_runner_sources",
"//flutter/testing",
] + flutter_deps
} }
executable("flutter_runner_scenic_unittests") { executable("flutter_runner_scenic_unittests") {
...@@ -369,84 +476,27 @@ executable("flutter_runner_scenic_unittests") { ...@@ -369,84 +476,27 @@ executable("flutter_runner_scenic_unittests") {
output_name = "flutter_runner_scenic_tests" output_name = "flutter_runner_scenic_tests"
sources = [ sources = [ "tests/session_connection_unittests.cc" ]
"component.cc",
"component.h",
"compositor_context.cc",
"compositor_context.h",
"engine.cc",
"engine.h",
"fuchsia_intl.cc",
"fuchsia_intl.h",
"isolate_configurator.cc",
"isolate_configurator.h",
"logging.h",
"loop.cc",
"loop.h",
"platform_view.cc",
"platform_view.h",
"runner.cc",
"runner.h",
"session_connection.cc",
"session_connection.h",
"surface.cc",
"surface.h",
"task_observers.cc",
"task_observers.h",
"task_runner_adapter.cc",
"task_runner_adapter.h",
"tests/session_connection_unittests.cc",
"thread.cc",
"thread.h",
"unique_fdio_ns.h",
"vsync_recorder.cc",
"vsync_recorder.h",
"vsync_waiter.cc",
"vsync_waiter.h",
"vsync_waiter_unittests.cc",
"vulkan_surface.cc",
"vulkan_surface.h",
"vulkan_surface_pool.cc",
"vulkan_surface_pool.h",
"vulkan_surface_producer.cc",
"vulkan_surface_producer.h",
]
# This is needed for //third_party/googletest for linking zircon symbols. # This is needed for //third_party/googletest for linking zircon symbols.
libs = [ "//fuchsia/sdk/$host_os/arch/$target_cpu/sysroot/lib/libzircon.so" ] libs = [ "//fuchsia/sdk/$host_os/arch/$target_cpu/sysroot/lib/libzircon.so" ]
deps = [ # The use of these dependencies is temporary and will be moved behind the
":flutter_runner_fixtures", # embedder API.
":jit", flutter_deps = [
"$fuchsia_sdk_root/fidl:fuchsia.ui.policy",
"$fuchsia_sdk_root/pkg:trace-provider-so",
"//build/fuchsia/fidl:fuchsia.accessibility.semantics",
"//build/fuchsia/pkg:async-default",
"//build/fuchsia/pkg:async-loop-cpp",
"//build/fuchsia/pkg:async-loop-default",
"//build/fuchsia/pkg:scenic_cpp",
"//build/fuchsia/pkg:sys_cpp_testing",
"//flutter/common",
"//flutter/flow:flow_fuchsia_legacy",
"//flutter/lib/ui:ui_fuchsia_legacy", "//flutter/lib/ui:ui_fuchsia_legacy",
"//flutter/runtime:runtime_fuchsia_legacy",
"//flutter/shell/common:common_fuchsia_legacy",
"//flutter/shell/platform/fuchsia/dart-pkg/fuchsia",
"//flutter/shell/platform/fuchsia/dart-pkg/zircon",
"//flutter/shell/platform/fuchsia/runtime/dart/utils",
"//flutter/testing",
"//flutter/vulkan",
"//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime:libdart_jit",
"//third_party/dart/runtime/platform:libdart_platform_jit", "//third_party/dart/runtime/platform:libdart_platform_jit",
"//third_party/icu",
"//third_party/skia",
] ]
public_deps = [ "//third_party/googletest:gtest" ] deps = [
":flutter_runner_fixtures",
":flutter_runner_sources",
"$fuchsia_sdk_root/fidl:fuchsia.ui.policy",
"//flutter/testing",
] + flutter_deps
} }
# When adding a new dep here, please also ensure the dep is added to
# testing/fuchsia/run_tests.sh and testing/fuchsia/test_fars
fuchsia_archive("flutter_runner_tests") { fuchsia_archive("flutter_runner_tests") {
testonly = true testonly = true
...@@ -793,6 +843,8 @@ fuchsia_test_archive("ui_tests_next") { ...@@ -793,6 +843,8 @@ fuchsia_test_archive("ui_tests_next") {
resources += vulkan_icds resources += vulkan_icds
} }
# When adding a new dep here, please also ensure the dep is added to
# testing/fuchsia/run_tests.sh and testing/fuchsia/test_fars
group("tests") { group("tests") {
testonly = true testonly = true
......
# 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.
assert(is_fuchsia)
import("//build/fuchsia/sdk.gni")
# Builds a flutter_runner
#
# Parameters:
#
# output_name (required):
# The name of the resulting binary.
#
# extra_deps (required):
# Any additional dependencies.
#
# product (required):
# Whether to link against a Product mode Dart VM.
#
# extra_defines (optional):
# Any additional preprocessor defines.
template("flutter_runner") {
assert(defined(invoker.output_name), "flutter_runner must define output_name")
assert(defined(invoker.extra_deps), "flutter_runner must define extra_deps")
assert(defined(invoker.product), "flutter_runner must define product")
invoker_output_name = invoker.output_name
extra_deps = invoker.extra_deps
extra_defines = []
if (defined(invoker.extra_defines)) {
extra_defines += invoker.extra_defines
}
executable(target_name) {
output_name = invoker_output_name
defines = extra_defines
libs = []
sources = [
"accessibility_bridge.cc",
"accessibility_bridge.h",
"component.cc",
"component.h",
"compositor_context.cc",
"compositor_context.h",
"engine.cc",
"engine.h",
"flutter_runner_product_configuration.cc",
"flutter_runner_product_configuration.h",
"fuchsia_intl.cc",
"fuchsia_intl.h",
"isolate_configurator.cc",
"isolate_configurator.h",
"logging.h",
"loop.cc",
"loop.h",
"main.cc",
"platform_view.cc",
"platform_view.h",
"runner.cc",
"runner.h",
"session_connection.cc",
"session_connection.h",
"surface.cc",
"surface.h",
"task_observers.cc",
"task_observers.h",
"task_runner_adapter.cc",
"task_runner_adapter.h",
"thread.cc",
"thread.h",
"unique_fdio_ns.h",
"vsync_recorder.cc",
"vsync_recorder.h",
"vsync_waiter.cc",
"vsync_waiter.h",
"vulkan_surface.cc",
"vulkan_surface.h",
"vulkan_surface_pool.cc",
"vulkan_surface_pool.h",
"vulkan_surface_producer.cc",
"vulkan_surface_producer.h",
]
# The use of these dependencies is temporary and will be moved behind the
# embedder API.
flutter_deps = [
"../flutter:fuchsia_legacy_gpu_configuration",
"//flutter/assets",
"//flutter/common",
"//flutter/flow:flow_fuchsia_legacy",
"//flutter/fml",
"//flutter/lib/ui:ui_fuchsia_legacy",
"//flutter/runtime:runtime_fuchsia_legacy",
"//flutter/shell/common:common_fuchsia_legacy",
"//flutter/vulkan",
]
_fuchsia_platform = "//flutter/shell/platform/fuchsia"
# TODO(kaushikiska) evaluate if all of these are needed.
fuchsia_deps = [
"${_fuchsia_platform}/dart-pkg/fuchsia",
"${_fuchsia_platform}/dart-pkg/zircon",
"${_fuchsia_platform}/runtime/dart/utils",
]
deps = [
"$fuchsia_sdk_root/fidl:fuchsia.accessibility.semantics",
"$fuchsia_sdk_root/fidl:fuchsia.fonts",
"$fuchsia_sdk_root/fidl:fuchsia.images",
"$fuchsia_sdk_root/fidl:fuchsia.intl",
"$fuchsia_sdk_root/fidl:fuchsia.io",
"$fuchsia_sdk_root/fidl:fuchsia.sys",
"$fuchsia_sdk_root/fidl:fuchsia.ui.app",
"$fuchsia_sdk_root/fidl:fuchsia.ui.scenic",
"$fuchsia_sdk_root/pkg:async-cpp",
"$fuchsia_sdk_root/pkg:async-default",
"$fuchsia_sdk_root/pkg:async-loop",
"$fuchsia_sdk_root/pkg:async-loop-cpp",
"$fuchsia_sdk_root/pkg:fdio",
"$fuchsia_sdk_root/pkg:fidl_cpp",
"$fuchsia_sdk_root/pkg:scenic_cpp",
"$fuchsia_sdk_root/pkg:sys_cpp",
"$fuchsia_sdk_root/pkg:syslog",
"$fuchsia_sdk_root/pkg:trace",
"$fuchsia_sdk_root/pkg:trace-engine",
"$fuchsia_sdk_root/pkg:trace-provider-so",
"$fuchsia_sdk_root/pkg:vfs_cpp",
"$fuchsia_sdk_root/pkg:zx",
"//third_party/skia",
"//flutter/third_party/tonic",
] + fuchsia_deps + flutter_deps + extra_deps
# The flags below are needed so that Dart's CPU profiler can walk the
# C++ stack.
cflags = [ "-fno-omit-frame-pointer" ]
if (!invoker.product) {
# This flag is needed so that the call to dladdr() in Dart's native symbol
# resolver can report good symbol information for the CPU profiler.
ldflags = [ "-rdynamic" ]
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册