@@ -10,6 +10,7 @@ import("$flutter_root/shell/gpu/gpu.gni")
1010import (" $flutter_root /tools/fuchsia/common_libs.gni" )
1111import (" $flutter_root /tools/fuchsia/dart.gni" )
1212import (" $flutter_root /tools/fuchsia/package_dir.gni" )
13+ import (" engine_flutter_runner.gni" )
1314
1415shell_gpu_configuration (" fuchsia_gpu_configuration" ) {
1516 enable_software = false
@@ -18,139 +19,33 @@ shell_gpu_configuration("fuchsia_gpu_configuration") {
1819 enable_metal = false
1920}
2021
21- # Builds a flutter_runner
22- #
23- # Parameters:
22+ # Things that explicitly being excluded:
23+ # 1. Kernel snapshot framework mode.
24+ # 2. Profiler symbols.
25+
26+ # Dependencies for flutter tooling
2427#
25- # output_name ( required):
26- # The name of the resulting binary .
28+ # While not required to run a flutter mod, these allow interacting
29+ # with flutter via the fx tool and need to be built .
2730#
28- # extra_deps (required):
29- # Any additional dependencies.
30- # extra_defines (optional):
31- # Any additional preprocessor defines.
32- template (" flutter_runner" ) {
33- assert (defined (invoker .output_name ), " flutter_runner must define output_name" )
34- assert (defined (invoker .extra_deps ), " flutter_runner must define extra_deps" )
35- assert (defined (invoker .product ), " flutter_runner must define product" )
36-
37- invoker_output_name = invoker .output_name
38- extra_deps = invoker .extra_deps
39-
40- extra_defines = []
41- if (defined (invoker .extra_defines )) {
42- extra_defines += invoker .extra_defines
43- }
44-
45- executable (target_name ) {
46- output_name = invoker_output_name
47-
48- defines = extra_defines
49-
50- libs = []
51-
52- sources = [
53- " component.cc" ,
54- " component.h" ,
55- " compositor_context.cc" ,
56- " compositor_context.h" ,
57- " engine.cc" ,
58- " engine.h" ,
59- " isolate_configurator.cc" ,
60- " isolate_configurator.h" ,
61- " logging.h" ,
62- " loop.cc" ,
63- " loop.h" ,
64- " main.cc" ,
65- " platform_view.cc" ,
66- " platform_view.h" ,
67- " runner.cc" ,
68- " runner.h" ,
69- " runner_context.cc" ,
70- " runner_context.h" ,
71- " service_provider_dir.cc" ,
72- " service_provider_dir.h" ,
73- " session_connection.cc" ,
74- " session_connection.h" ,
75- " surface.cc" ,
76- " surface.h" ,
77- " task_observers.cc" ,
78- " task_observers.h" ,
79- " task_runner_adapter.cc" ,
80- " task_runner_adapter.h" ,
81- " thread.cc" ,
82- " thread.h" ,
83- " unique_fdio_ns.h" ,
84- " vsync_recorder.cc" ,
85- " vsync_recorder.h" ,
86- " vsync_waiter.cc" ,
87- " vsync_waiter.h" ,
88- " vulkan_surface.cc" ,
89- " vulkan_surface.h" ,
90- " vulkan_surface_pool.cc" ,
91- " vulkan_surface_pool.h" ,
92- " vulkan_surface_producer.cc" ,
93- " vulkan_surface_producer.h" ,
94- ]
31+ # This is only for builds in topaz tree.
32+ flutter_tool_deps = []
33+ if (! using_fuchsia_sdk ) {
34+ flutter_tool_deps += [ " //third_party/dart-pkg/git/flutter/packages/flutter_tools:fuchsia_attach($host_toolchain )" ]
35+ }
9536
96- deps = [
97- " :fuchsia_gpu_configuration" ,
98- " $flutter_root /common" ,
99- " $flutter_root /flow" ,
100- " $flutter_root /fml" ,
101- " $flutter_root /lib/ui" ,
102- " $flutter_root /runtime" ,
103- " $flutter_root /runtime:libdart" ,
104- " $flutter_root /shell/common" ,
105- " $flutter_root /shell/platform/fuchsia/dart-pkg/fuchsia" ,
106- " $flutter_root /shell/platform/fuchsia/dart-pkg/zircon" ,
107- " $flutter_root /shell/platform/fuchsia/runtime/dart/utils" ,
108- " $flutter_root /vulkan" ,
109- " $fuchsia_sdk_root /fidl:fuchsia.fonts" ,
110- " $fuchsia_sdk_root /fidl:fuchsia.images" ,
111- " $fuchsia_sdk_root /fidl:fuchsia.io" ,
112- " $fuchsia_sdk_root /fidl:fuchsia.modular" ,
113- " $fuchsia_sdk_root /fidl:fuchsia.sys" ,
114- " $fuchsia_sdk_root /fidl:fuchsia.ui.app" ,
115- " $fuchsia_sdk_root /fidl:fuchsia.ui.scenic" ,
116- " $fuchsia_sdk_root /pkg:async-cpp" ,
117- " $fuchsia_sdk_root /pkg:async-loop" ,
118- " $fuchsia_sdk_root /pkg:async-loop-cpp" ,
119- " $fuchsia_sdk_root /pkg:fdio" ,
120- " $fuchsia_sdk_root /pkg:fidl_cpp" ,
121- " $fuchsia_sdk_root /pkg:scenic_cpp" ,
122- " $fuchsia_sdk_root /pkg:syslog" ,
123- " $fuchsia_sdk_root /pkg:trace" ,
124- " $fuchsia_sdk_root /pkg:trace-engine" ,
125- " $fuchsia_sdk_root /pkg:trace-provider-so" ,
126- " $fuchsia_sdk_root /pkg:zx" ,
127- " $fuchsia_sdk_root /pkg/lib/sys/cpp" ,
128- " $fuchsia_sdk_root /pkg/lib/vfs/cpp" ,
129- " //third_party/skia" ,
130- " //third_party/tonic" ,
131- ] + extra_deps
132-
133- # The flags below are needed so that Dart's CPU profiler can walk the
134- # C++ stack.
135- cflags = [ " -fno-omit-frame-pointer" ]
136-
137- if (! invoker .product ) {
138- # This flag is needed so that the call to dladdr() in Dart's native symbol
139- # resolver can report good symbol information for the CPU profiler.
140- ldflags = [ " -rdynamic" ]
141- }
37+ flutter_runner (" jit" ) {
38+ output_name = " flutter_jit_runner"
39+ product = false
40+ if (flutter_runtime_mode == " profile" ) {
41+ extra_defines = [ " FLUTTER_PROFILE" ]
14242 }
143- }
14443
145- # Things that explicitly being excluded:
146- # 1. flutter_profile flag.
147- # 2. Injecting flutter tool specific stuff.
148- # 3. Product mode is going to be false for now.
149- # 4. Kernel snapshot: framework and product.
150- # 5. Observatoory stuff.
151- # 6. Profiler symbols.
152- # 7. framework and product!! (_framework snapshots and dilp files.)
153- # 8. CMX files are also ignored.
44+ extra_deps = [
45+ " //third_party/dart/runtime:libdart_jit" ,
46+ " //third_party/dart/runtime/platform:libdart_platform_jit" ,
47+ ] + flutter_tool_deps
48+ }
15449
15550flutter_runner (" jit_product" ) {
15651 output_name = " flutter_jit_product_runner"
@@ -163,19 +58,6 @@ flutter_runner("jit_product") {
16358 ]
16459}
16560
166- flutter_runner (" jit" ) {
167- output_name = " flutter_jit_runner"
168- product = false
169- if (flutter_runtime_mode == " profile" ) {
170- extra_defines = [ " FLUTTER_PROFILE" ]
171- }
172-
173- extra_deps = [
174- " //third_party/dart/runtime:libdart_jit" ,
175- " //third_party/dart/runtime/platform:libdart_platform_jit" ,
176- ]
177- }
178-
17961flutter_runner (" aot" ) {
18062 output_name = " flutter_aot_runner"
18163 product = false
@@ -208,12 +90,12 @@ template("jit_runner") {
20890 }
20991
21092 package_dir (target_name ) {
211- snapshot_gen_dir =
212- " $root_build_dir /gen/flutter/shell/platform/fuchsia/flutter/kernel "
93+ snapshot_label = " kernel:kernel_core_snapshot ${ product_suffix } "
94+ snapshot_gen_dir = get_label_info ( snapshot_label , " target_gen_dir " )
21395
21496 deps = [
21597 " :jit${ product_suffix } " ,
216- " kernel:kernel_core_snapshot ${ product_suffix } " ,
98+ snapshot_label ,
21799 ]
218100
219101 if (! product ) {
@@ -346,8 +228,7 @@ executable("flutter_runner_unittests") {
346228 " sample_unittests.cc" ,
347229 ]
348230
349- # This is needed for //third_party/googletest for linking zircon
350- # symbols.
231+ # This is needed for //third_party/googletest for linking zircon symbols.
351232 libs = [ " //fuchsia/sdk/$host_os /arch/$target_cpu /sysroot/lib/libzircon.so" ]
352233
353234 deps = [
0 commit comments