44
55import (" //flutter/common/config.gni" )
66import (" //flutter/shell/platform/config.gni" )
7-
8- if (is_fuchsia ) {
9- import (" //build/fuchsia/sdk.gni" )
10- }
7+ import (" //flutter/testing/testing.gni" )
118
129# Whether to build the dartdevc sdk, libraries, and source files
1310# required for the flutter web sdk.
1411declare_args () {
1512 full_dart_sdk = false
1613}
1714
18- group (" flutter" ) {
19- testonly = true
15+ config (" config" ) {
16+ include_dirs = [ " .." ]
17+ if (is_win ) {
18+ if (current_cpu != " x86" ) {
19+ cflags = [ " /WX" ] # Treat warnings as errors.
20+ }
21+ }
22+ }
2023
21- public_deps = []
24+ # This "fuchsia_legacy" configuration includes old, non-embedder API sources and
25+ # defines the LEGACY_FUCHSIA_EMBEDDER symbol. This config and its associated
26+ # template are both transitional and will be removed after the embedder API
27+ # transition is complete.
28+ #
29+ # See `source_set_maybe_fuchsia_legacy` in //flutter/common/config.gni
30+ #
31+ # TODO(fxb/54041): Remove when no longer neccesary.
32+ config (" fuchsia_legacy" ) {
33+ if (is_fuchsia ) {
34+ defines = [ " LEGACY_FUCHSIA_EMBEDDER" ]
35+ }
36+ }
2237
23- if ( ! is_fuchsia ) {
24- public_deps += [
25- " //flutter/lib/snapshot:generate_snapshot_bin " ,
26- " //flutter/lib/snapshot:kernel_platform_files " ,
38+ config ( " export_dynamic_symbols " ) {
39+ if ( is_linux || is_fuchsia ) {
40+ inputs = [
41+ " //flutter/common/exported_symbols.sym " ,
2742 ]
43+ ldflags = [ " -Wl,--dynamic-list=" + rebase_path (inputs [0 ], root_build_dir ) ]
2844 }
45+ }
2946
30- public_deps += [
47+ group (" flutter" ) {
48+ testonly = true
49+
50+ # Compile the engine.
51+ public_deps = [
3152 " //flutter/shell/platform/embedder:flutter_engine" ,
3253 " //flutter/sky" ,
3354 ]
3455
35- if (current_toolchain == host_toolchain ) {
36- public_deps += [ " //flutter/tools/font-subset" ]
37- }
38-
39- if (current_toolchain == host_toolchain ) {
40- public_deps += [ " //flutter/shell/testing" ]
41- public_deps += [ " //flutter/tools/const_finder" ]
42- }
43-
44- if (is_fuchsia ) {
56+ # If enbaled, compile the SDK / snapshot.
57+ if (! is_fuchsia ) {
4558 public_deps += [
46- " //flutter/shell/platform/fuchsia " ,
47- " //flutter/shell/testing( $host_toolchain ) " ,
59+ " //flutter/lib/snapshot:generate_snapshot_bin " ,
60+ " //flutter/lib/snapshot:kernel_platform_files " ,
4861 ]
49- }
5062
51- if (! is_fuchsia ) {
5263 if (current_toolchain == host_toolchain ) {
5364 public_deps += [
5465 " //flutter/flutter_frontend_server:frontend_server" ,
@@ -61,93 +72,95 @@ group("flutter") {
6172 }
6273 }
6374
64- # If on the host, compile all unittests targets .
75+ # If on the host, compile tools .
6576 if (current_toolchain == host_toolchain ) {
66- if (is_mac ) {
67- public_deps +=
68- [ " //flutter/shell/platform/darwin:flutter_channels_unittests" ]
69- }
77+ public_deps += [
78+ " //flutter/shell/testing" ,
79+ " //flutter/tools/const_finder" ,
80+ " //flutter/tools/font-subset" ,
81+ ]
82+ }
83+
84+ # Compile all benchmark targets if enabled.
85+ if (enable_unittests && ! is_win ) {
86+ public_deps += [
87+ " //flutter/fml:fml_benchmarks" ,
88+ " //flutter/lib/ui:ui_benchmarks" ,
89+ " //flutter/shell/common:shell_benchmarks" ,
90+ " //flutter/third_party/txt:txt_benchmarks" ,
91+ ]
92+ }
7093
94+ # Compile all unittests targets if enabled.
95+ if (enable_unittests ) {
7196 public_deps += [
7297 " //flutter/flow:flow_unittests" ,
7398 " //flutter/fml:fml_unittests" ,
7499 " //flutter/lib/ui:ui_unittests" ,
75100 " //flutter/runtime:runtime_unittests" ,
76101 " //flutter/shell/common:shell_unittests" ,
77- " //flutter/shell/platform/embedder:embedder_unittests" ,
78102 " //flutter/testing:testing_unittests" ,
79103 " //flutter/third_party/txt:txt_unittests" ,
80104 ]
81105
82- if (! is_win ) {
106+ if (is_fuchsia ) {
107+ public_deps += [ " //flutter/shell/platform/fuchsia:tests" ]
108+ }
109+
110+ if (is_mac ) {
111+ public_deps +=
112+ [ " //flutter/shell/platform/darwin:flutter_channels_unittests" ]
113+ }
114+
115+ if (! is_win && ! is_fuchsia ) {
83116 public_deps += [
84- " //flutter/fml:fml_benchmarks" ,
85- " //flutter/lib/ui:ui_benchmarks" ,
86- " //flutter/shell/common:shell_benchmarks" ,
87117 " //flutter/shell/platform/android/external_view_embedder:android_external_view_embedder_unittests" ,
88118 " //flutter/shell/platform/android/jni:jni_unittests" ,
89- " //flutter/third_party/txt:txt_benchmarks" ,
90119 ]
91120 }
92121
122+ # TODO(): Enable embedder_unittests on fucsia.
123+ if (! is_fuchsia ) {
124+ public_deps += [ " //flutter/shell/platform/embedder:embedder_unittests" ]
125+ }
126+
93127 # Unit tests for desktop embeddings should only be built if the desktop
94128 # embeddings are being built.
95129 if (enable_desktop_embeddings ) {
96130 public_deps += [
97131 " //flutter/shell/platform/common/cpp:common_cpp_core_unittests" ,
98- " //flutter/shell/platform/common/cpp:common_cpp_unittests" ,
99132 " //flutter/shell/platform/common/cpp/client_wrapper:client_wrapper_unittests" ,
100- " //flutter/shell/platform/glfw/client_wrapper:client_wrapper_glfw_unittests" ,
101133 ]
134+
135+ if (! is_fuchsia ) {
136+ # These tests require the embedder and thus cannot run on fuchsia.
137+ # TODO(): Enable when embedder works on fuchsia.
138+ public_deps +=
139+ [ " //flutter/shell/platform/common/cpp:common_cpp_unittests" ]
140+
141+ # These tests require GLFW and thus cannot run on fuchsia.
142+ public_deps += [ " //flutter/shell/platform/glfw/client_wrapper:client_wrapper_glfw_unittests" ]
143+ }
144+
145+ if (is_linux ) {
146+ public_deps +=
147+ [ " //flutter/shell/platform/linux:flutter_linux_unittests" ]
148+ }
149+
102150 if (is_mac ) {
103151 public_deps += [ " //flutter/shell/platform/darwin/macos:flutter_desktop_darwin_unittests" ]
104152 }
153+
105154 if (is_win ) {
106155 public_deps += [
107156 " //flutter/shell/platform/windows:flutter_windows_unittests" ,
108157 " //flutter/shell/platform/windows/client_wrapper:client_wrapper_windows_unittests" ,
109158 ]
110159 }
111- if (is_linux ) {
112- public_deps +=
113- [ " //flutter/shell/platform/linux:flutter_linux_unittests" ]
114- }
115160 }
116161 }
117162}
118163
119- config (" config" ) {
120- include_dirs = [ " .." ]
121- if (is_win ) {
122- if (current_cpu != " x86" ) {
123- cflags = [ " /WX" ] # Treat warnings as errors.
124- }
125- }
126- }
127-
128- # This "fuchsia_legacy" configuration includes old, non-embedder API sources and
129- # defines the LEGACY_FUCHSIA_EMBEDDER symbol. This config and its associated
130- # template are both transitional and will be removed after the embedder API
131- # transition is complete.
132- #
133- # See `source_set_maybe_fuchsia_legacy` in //flutter/common/config.gni
134- #
135- # TODO(fxb/54041): Remove when no longer neccesary.
136- config (" fuchsia_legacy" ) {
137- if (is_fuchsia ) {
138- defines = [ " LEGACY_FUCHSIA_EMBEDDER" ]
139- }
140- }
141-
142- config (" export_dynamic_symbols" ) {
143- if (is_linux || is_fuchsia ) {
144- inputs = [
145- " //flutter/common/exported_symbols.sym" ,
146- ]
147- ldflags = [ " -Wl,--dynamic-list=" + rebase_path (inputs [0 ], root_build_dir ) ]
148- }
149- }
150-
151164group (" dist" ) {
152165 testonly = true
153166
@@ -156,23 +169,12 @@ group("dist") {
156169 ]
157170}
158171
159- # Fuchsia currently only supports a subset of our unit tests
160- # When adding a new dep here, please also ensure the dep is added to
161- # testing/fuchsia/run_tests.sh and testing/fuchsia/test_fars
162172if (is_fuchsia ) {
163173 group (" fuchsia_tests" ) {
164174 testonly = true
165175
166176 deps = [
167- " //flutter/flow:flow_tests" ,
168- " //flutter/flow:flow_tests_next" ,
169- " //flutter/fml:fml_tests" ,
170- " //flutter/runtime:runtime_tests" ,
171- " //flutter/runtime:runtime_tests_next" ,
172- " //flutter/shell/common:shell_tests" ,
173- " //flutter/shell/common:shell_tests_next" ,
174- " //flutter/shell/platform/fuchsia/flutter:flutter_runner_scenic_tests" ,
175- " //flutter/shell/platform/fuchsia/flutter:flutter_runner_tests" ,
177+ " //flutter/shell/platform/fuchsia:tests" ,
176178 ]
177179 }
178180}
0 commit comments