forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.gn
175 lines (148 loc) · 4.93 KB
/
BUILD.gn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# 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")
import("//flutter/testing/testing.gni")
# Whether to build the dartdevc sdk, libraries, and source files
# required for the flutter web sdk.
declare_args() {
full_dart_sdk = false
}
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("flutter") {
testonly = true
# Compile the engine.
public_deps = [
"//flutter/shell/platform/embedder:flutter_engine",
"//flutter/sky",
]
# If enbaled, compile the SDK / snapshot.
if (!is_fuchsia) {
public_deps += [
"//flutter/lib/snapshot:generate_snapshot_bin",
"//flutter/lib/snapshot:kernel_platform_files",
]
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 tools.
if (current_toolchain == host_toolchain) {
public_deps += [
"//flutter/shell/testing",
"//flutter/tools/const_finder",
"//flutter/tools/font-subset",
]
}
# Compile all benchmark targets if enabled.
if (enable_unittests && !is_win) {
public_deps += [
"//flutter/fml:fml_benchmarks",
"//flutter/lib/ui:ui_benchmarks",
"//flutter/shell/common:shell_benchmarks",
"//flutter/third_party/txt:txt_benchmarks",
]
}
# Compile all unittests targets if enabled.
if (enable_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/testing:testing_unittests",
"//flutter/third_party/txt:txt_unittests",
]
if (is_fuchsia) {
public_deps += [ "//flutter/shell/platform/fuchsia:tests" ]
}
if (is_mac) {
public_deps +=
[ "//flutter/shell/platform/darwin:flutter_channels_unittests" ]
}
if (!is_win && !is_fuchsia) {
public_deps += [
"//flutter/shell/platform/android/external_view_embedder:android_external_view_embedder_unittests",
"//flutter/shell/platform/android/jni:jni_unittests",
"//flutter/shell/platform/android/platform_view_android_delegate:platform_view_android_delegate_unittests",
]
}
# TODO(): Enable embedder_unittests on fucsia.
if (!is_fuchsia) {
public_deps += [ "//flutter/shell/platform/embedder:embedder_unittests" ]
}
# 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/client_wrapper:client_wrapper_unittests",
]
if (!is_fuchsia) {
# These tests require the embedder and thus cannot run on fuchsia.
# TODO(): Enable when embedder works on fuchsia.
public_deps +=
[ "//flutter/shell/platform/common/cpp:common_cpp_unittests" ]
# These tests require GLFW and thus cannot run on fuchsia.
public_deps += [ "//flutter/shell/platform/glfw/client_wrapper:client_wrapper_glfw_unittests" ]
}
if (is_linux) {
public_deps +=
[ "//flutter/shell/platform/linux:flutter_linux_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",
]
}
}
}
}
group("dist") {
testonly = true
deps = [ "//flutter/sky/dist" ]
}
if (is_fuchsia) {
group("fuchsia_tests") {
testonly = true
deps = [ "//flutter/shell/platform/fuchsia:tests" ]
}
}