-
Notifications
You must be signed in to change notification settings - Fork 6k
/
Copy pathBUILD.gn
118 lines (93 loc) · 3.23 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
# 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.
assert(is_mac || is_ios)
import("//flutter/common/config.gni")
import("//flutter/testing/testing.gni")
import("framework_common.gni")
source_set("common") {
cflags_objc = flutter_cflags_objc
cflags_objcc = flutter_cflags_objcc
sources = [
"buffer_conversions.h",
"buffer_conversions.mm",
"command_line.h",
"command_line.mm",
]
deps = [
":availability_version_check",
"//flutter/fml",
]
public_configs = [ "//flutter:config" ]
}
# Provides an implementation for _availability_version_check.
#
# This is required due to an upstream compiler builtin (runtime) change
# that marked this function as weakly-linked via __attribute__((weak import))
# As such, no linking failure occurs when the function is unavailable at
# link time. Since the symbol is no longer linked in, App Store review blocks
# publishing due to relying on a private symbol. Instead we link in our own
# implementation, which provides the exact implementation used in clang prior
# to the upstream change.
#
# See: Upstream clang change: https://reviews.llvm.org/D150397
# See: https://github.com/flutter/flutter/issues/133777
source_set("availability_version_check") {
cflags_objc = flutter_cflags_objc
cflags_objcc = flutter_cflags_objcc
sources = [ "availability_version_check.cc" ]
deps = [ "//flutter/fml" ]
public_configs = [ "//flutter:config" ]
}
# Shared framework headers end up in the same folder as platform-specific
# framework headers when consumed by clients, so the include paths assume they
# are next to each other.
config("framework_relative_headers") {
include_dirs = [ "framework/Headers" ]
}
# Framework code shared between iOS and macOS.
source_set("framework_common") {
cflags_objc = flutter_cflags_objc_arc
cflags_objcc = flutter_cflags_objcc_arc
sources = [
"framework/Source/FlutterBinaryMessengerRelay.mm",
"framework/Source/FlutterChannels.mm",
"framework/Source/FlutterCodecs.mm",
"framework/Source/FlutterNSBundleUtils.h",
"framework/Source/FlutterNSBundleUtils.mm",
"framework/Source/FlutterStandardCodec.mm",
"framework/Source/FlutterStandardCodecHelper.cc",
"framework/Source/FlutterStandardCodec_Internal.h",
]
public = framework_common_headers
public += [ "framework/Source/FlutterNSBundleUtils.h" ]
defines = [ "FLUTTER_FRAMEWORK" ]
public_configs = [
"//flutter:config",
":framework_relative_headers",
]
deps = [ "//flutter/fml" ]
}
test_fixtures("framework_common_fixtures") {
fixtures = []
}
# Unit tests for channels.
executable("framework_common_unittests") {
testonly = true
sources = [
"framework/Source/FlutterBinaryMessengerRelayTest.mm",
"framework/Source/FlutterTestUtils.mm",
"framework/Source/flutter_codecs_unittest.mm",
"framework/Source/flutter_standard_codec_unittest.mm",
]
cflags_objcc = flutter_cflags_objcc_arc
ldflags = [ "-ObjC" ]
deps = [
":framework_common",
":framework_common_fixtures",
"//flutter/testing",
"//third_party/dart/runtime:libdart_jit",
"//third_party/ocmock:ocmock",
]
public_configs = [ "//flutter:config" ]
}