forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.gni
128 lines (109 loc) · 4.19 KB
/
config.gni
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
# 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.
if (is_android) {
import("//build/config/android/config.gni")
}
if (target_cpu == "arm" || target_cpu == "arm64") {
import("//build/config/arm.gni")
}
declare_args() {
# The runtime mode ("debug", "profile", "release", or "jit_release")
flutter_runtime_mode = "debug"
# Whether to link the Skia text shaper module into the engine
flutter_enable_skshaper = false
# Whether to use the Skia text shaper module for all text rendering
flutter_always_use_skshaper = false
# Whether to use a prebuilt Dart SDK instead of building one.
flutter_prebuilt_dart_sdk = false
}
# feature_defines_list ---------------------------------------------------------
feature_defines_list = [
"FLUTTER_RUNTIME_MODE_DEBUG=1",
"FLUTTER_RUNTIME_MODE_PROFILE=2",
"FLUTTER_RUNTIME_MODE_RELEASE=3",
"FLUTTER_RUNTIME_MODE_JIT_RELEASE=4",
"DART_LEGACY_API=[[deprecated]]",
]
if (flutter_runtime_mode == "debug") {
feature_defines_list += [
"FLUTTER_RUNTIME_MODE=1",
"FLUTTER_JIT_RUNTIME=1",
]
} else if (flutter_runtime_mode == "profile") {
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=2" ]
} else if (flutter_runtime_mode == "release") {
feature_defines_list += [
"FLUTTER_RUNTIME_MODE=3",
"FLUTTER_RELEASE=1",
]
} else if (flutter_runtime_mode == "jit_release") {
feature_defines_list += [
"FLUTTER_RUNTIME_MODE=4",
"FLUTTER_RELEASE=1",
"FLUTTER_JIT_RUNTIME=1",
]
} else {
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=0" ]
}
if (is_ios || is_mac) {
flutter_cflags_objc = [
"-Werror=overriding-method-mismatch",
"-Werror=undeclared-selector",
]
flutter_cflags_objcc = flutter_cflags_objc
flutter_cflags_objc_arc = flutter_cflags_objc + [ "-fobjc-arc" ]
flutter_cflags_objcc_arc = flutter_cflags_objc_arc
}
# A combo of host os name and cpu is used in several locations to
# generate the names of the archived artifacts.
_platform_name = host_os
if (_platform_name == "mac") {
_platform_name = "darwin"
} else if (_platform_name == "win" || _platform_name == "winuwp") {
_platform_name = "windows"
}
full_platform_name = "$_platform_name-$host_cpu"
# Prebuilt Dart SDK location
if (flutter_prebuilt_dart_sdk) {
_target_os_name = target_os
if (_target_os_name == "mac") {
_target_os_name = "macos"
} else if (_target_os_name == "win" || _target_os_name == "winuwp") {
_target_os_name = "windows"
}
_host_os_name = host_os
if (_host_os_name == "mac") {
_host_os_name = "macos"
} else if (_host_os_name == "win" || _host_os_name == "winuwp") {
_host_os_name = "windows"
}
_target_prebuilt_dart_sdk_config = "$_target_os_name-$target_cpu"
_host_prebuilt_dart_sdk_config = "$_host_os_name-$host_cpu"
_target_prebuilt_dart_sdk_archive = "//flutter/prebuilts/dartsdk-$_target_prebuilt_dart_sdk_config-release.zip"
_host_prebuilt_dart_sdk_archive =
"//flutter/prebuilts/dartsdk-$_host_prebuilt_dart_sdk_config-release.zip"
target_prebuilt_dart_sdk =
"//flutter/prebuilts/$_target_prebuilt_dart_sdk_config/dart-sdk"
host_prebuilt_dart_sdk =
"//flutter/prebuilts/$_host_prebuilt_dart_sdk_config/dart-sdk"
# There is no prebuilt Dart SDK targeting Fuchsia, but we also don't need
# one, so even when the build is targeting Fuchsia, use the prebuilt
# Dart SDK for the host.
if (current_toolchain == host_toolchain || is_fuchsia) {
prebuilt_dart_sdk = host_prebuilt_dart_sdk
prebuilt_dart_sdk_config = _host_prebuilt_dart_sdk_config
prebuilt_dart_sdk_archive = _host_prebuilt_dart_sdk_archive
} else {
prebuilt_dart_sdk = target_prebuilt_dart_sdk
prebuilt_dart_sdk_config = _target_prebuilt_dart_sdk_config
prebuilt_dart_sdk_archive = _target_prebuilt_dart_sdk_archive
}
}
# Flutter SDK artifacts should only be built when either doing host builds, or
# for cross-compiled desktop targets.
# TODO: We can't build the engine artifacts for arm (32-bit) right now;
# see https://github.com/flutter/flutter/issues/74322
build_engine_artifacts =
current_toolchain == host_toolchain ||
(is_linux && !is_chromeos && current_cpu != "arm") || is_mac