Repository navigation
Expand file tree
/
Copy pathplugin_lib.gni
More file actions
179 lines (171 loc) · 4.95 KB
/
Copy pathplugin_lib.gni
File metadata and controls
179 lines (171 loc) · 4.95 KB
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
176
177
178
179
# Copyright (c) 2022-2026 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos.gni")
common_plugin_libs = [
"ability_access_ctrl",
"accessibility",
"arkui/advanced/dialog",
"arkui/advanced/segmentbutton",
"arkui/advanced/subheader",
"arkui/advanced/toolbar",
"arkui/advanced/counter",
"arkui/advanced/filter",
"arkui/advanced/progressbutton",
"arkui/advanced/splitlayout",
"arkui/advanced/popup",
"arkui/advanced/treeview",
"arkui/advanced/chip",
"arkui/advanced/editabletitlebar",
"arkui/advanced/tabtitlebar",
"arkui/advanced/foldsplitcontainer",
"arkui/advanced/exceptionprompt",
"arkui/advanced/gridobjectsortcomponent",
"arkui/advanced/chipgroup",
"arkui/mock",
"arkui/modifier",
"bluetooth/access",
"bluetooth/baseprofile",
"bluetooth/ble",
"bluetooth/connection",
"bluetooth/a2dp",
"bluetooth/constant",
"bridge",
"file/fs",
"file/hash",
"file/streamhash",
"file/statvfs",
"file/storage_statistics",
"file/photo_access_helper",
"file/picker",
"file/streamrw",
"file/fileuri",
"common_event_manager",
"data/datasharepredicates",
"data/distributedkvstore",
"data/preferences",
"pasteboard",
"data/relationalstore",
"data/unifieddatachannel",
"data/uniformtypedescriptor",
"device_info",
"display",
"hitrace_meter",
"i18n",
"intl",
"multimedia/media",
"multimedia/audio",
"net/connection",
"net/http",
"net/socket",
"net/websocket",
"worker",
"request",
"request/cachedownload",
"buffer",
"fastbuffer",
"geo_location_manager",
"convertxml",
"process",
"system_date_time",
"uitest",
"uri",
"url",
"xml",
"util",
"util/arraylist",
"util/deque",
"util/hashmap",
"util/hashset",
"util/lightweightmap",
"util/lightweightset",
"util/linkedlist",
"util/list",
"util/plainarray",
"util/queue",
"util/stack",
"util/treemap",
"util/treeset",
"util/json",
"util/stream",
"hilog",
"taskpool",
"test_plugin",
"timer",
"console",
"ui_appearance",
"web/webview",
"zlib",
"security/cryptoframework",
"security/cert",
"events/emitter",
"wifi_manager",
"notification_manager",
"effectkit",
"arkui/node",
"multimodalinput/keycode",
"arkts/collections",
"arkts/utils",
"arkts/math/decimal",
"hiviewdfx/hiappevent",
"arkui/advanced/swiperefresher",
"arkui/advanced/composelistitem",
"arkui/advanced/composetitlebar",
"arkui/advanced/selecttitlebar",
"arkui/advanced/selectionmenu",
"vibrator",
"graphics/text",
]
template("plugin_lib") {
forward_variables_from(invoker, "*")
plugin_name = target_name
target_name_tmp = string_replace(target_name, "_", "")
target_name_ext = string_replace(target_name_tmp, "/", "_")
plugin_name_ext = string_replace(plugin_name, "/", "_")
if (platform == "ios") {
ohos_source_set(target_name_ext) {
deps = [ "//plugins/$plugin_name:${plugin_name_ext}_static_${platform}" ]
part_names = string_split(plugin_name, "/")
part_name = part_names[0]
subsystem_name = "plugins"
}
} else {
ohos_shared_library(target_name_ext) {
deps = [ "//plugins/$plugin_name:${plugin_name_ext}_static_${platform}" ]
# Statically link libc++abi into every plugin .so. Without this, lld may
# resolve C++ runtime symbols (e.g. std::runtime_error::what()) against
# the libarkui_android.so that is present at link time, which exports
# them in some builds but not in the one shipped in the SDK/APK —
# leaving the symbols UNDEF at runtime and failing dlopen.
# (root-caused 2026-09-03: request module load failure on Android)
#
# Guard by target_os: plugin_lib templates declared in plugins/*/BUILD.gn
# with platform="android" are also evaluated when the iOS toolchain loads
# those files (e.g. plugins/request/cachedownload via
# request_cachedownload_static_ios deps). aosp_libcpp_lib_dir is only
# defined when target_os=="android" (imported in build/config/config.gni),
# so an unguarded reference breaks GN gen on the iOS gate with
# "Undefined identifier in string expansion".
if (target_os == "android") {
ldflags = [
"-Wl,--whole-archive",
rebase_path("$aosp_libcpp_lib_dir/libc++abi.a", root_build_dir),
"-Wl,--no-whole-archive",
]
}
relative_install_dir = "module"
part_names = string_split(plugin_name, "/")
part_name = part_names[0]
subsystem_name = "plugins"
}
}
}