4
4
5
5
import (" //flutter/common/config.gni" )
6
6
import (" //flutter/shell/platform/config.gni" )
7
-
8
- if (is_fuchsia ) {
9
- import (" //build/fuchsia/sdk.gni" )
10
- }
7
+ import (" //flutter/testing/testing.gni" )
11
8
12
9
# Whether to build the dartdevc sdk, libraries, and source files
13
10
# required for the flutter web sdk.
14
11
declare_args () {
15
12
full_dart_sdk = false
16
13
}
17
14
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
+ }
20
23
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
+ }
22
37
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 " ,
27
42
]
43
+ ldflags = [ " -Wl,--dynamic-list=" + rebase_path (inputs [0 ], root_build_dir ) ]
28
44
}
45
+ }
29
46
30
- public_deps += [
47
+ group (" flutter" ) {
48
+ testonly = true
49
+
50
+ # Compile the engine.
51
+ public_deps = [
31
52
" //flutter/shell/platform/embedder:flutter_engine" ,
32
53
" //flutter/sky" ,
33
54
]
34
55
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 ) {
45
58
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 " ,
48
61
]
49
- }
50
62
51
- if (! is_fuchsia ) {
52
63
if (current_toolchain == host_toolchain ) {
53
64
public_deps += [
54
65
" //flutter/flutter_frontend_server:frontend_server" ,
@@ -61,93 +72,95 @@ group("flutter") {
61
72
}
62
73
}
63
74
64
- # If on the host, compile all unittests targets .
75
+ # If on the host, compile tools .
65
76
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
+ }
70
93
94
+ # Compile all unittests targets if enabled.
95
+ if (enable_unittests ) {
71
96
public_deps += [
72
97
" //flutter/flow:flow_unittests" ,
73
98
" //flutter/fml:fml_unittests" ,
74
99
" //flutter/lib/ui:ui_unittests" ,
75
100
" //flutter/runtime:runtime_unittests" ,
76
101
" //flutter/shell/common:shell_unittests" ,
77
- " //flutter/shell/platform/embedder:embedder_unittests" ,
78
102
" //flutter/testing:testing_unittests" ,
79
103
" //flutter/third_party/txt:txt_unittests" ,
80
104
]
81
105
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 ) {
83
116
public_deps += [
84
- " //flutter/fml:fml_benchmarks" ,
85
- " //flutter/lib/ui:ui_benchmarks" ,
86
- " //flutter/shell/common:shell_benchmarks" ,
87
117
" //flutter/shell/platform/android/external_view_embedder:android_external_view_embedder_unittests" ,
88
118
" //flutter/shell/platform/android/jni:jni_unittests" ,
89
- " //flutter/third_party/txt:txt_benchmarks" ,
90
119
]
91
120
}
92
121
122
+ # TODO(): Enable embedder_unittests on fucsia.
123
+ if (! is_fuchsia ) {
124
+ public_deps += [ " //flutter/shell/platform/embedder:embedder_unittests" ]
125
+ }
126
+
93
127
# Unit tests for desktop embeddings should only be built if the desktop
94
128
# embeddings are being built.
95
129
if (enable_desktop_embeddings ) {
96
130
public_deps += [
97
131
" //flutter/shell/platform/common/cpp:common_cpp_core_unittests" ,
98
- " //flutter/shell/platform/common/cpp:common_cpp_unittests" ,
99
132
" //flutter/shell/platform/common/cpp/client_wrapper:client_wrapper_unittests" ,
100
- " //flutter/shell/platform/glfw/client_wrapper:client_wrapper_glfw_unittests" ,
101
133
]
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
+
102
150
if (is_mac ) {
103
151
public_deps += [ " //flutter/shell/platform/darwin/macos:flutter_desktop_darwin_unittests" ]
104
152
}
153
+
105
154
if (is_win ) {
106
155
public_deps += [
107
156
" //flutter/shell/platform/windows:flutter_windows_unittests" ,
108
157
" //flutter/shell/platform/windows/client_wrapper:client_wrapper_windows_unittests" ,
109
158
]
110
159
}
111
- if (is_linux ) {
112
- public_deps +=
113
- [ " //flutter/shell/platform/linux:flutter_linux_unittests" ]
114
- }
115
160
}
116
161
}
117
162
}
118
163
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
-
151
164
group (" dist" ) {
152
165
testonly = true
153
166
@@ -156,23 +169,12 @@ group("dist") {
156
169
]
157
170
}
158
171
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
162
172
if (is_fuchsia ) {
163
173
group (" fuchsia_tests" ) {
164
174
testonly = true
165
175
166
176
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" ,
176
178
]
177
179
}
178
180
}
0 commit comments