blob: 620742115e9ed84e7a75f90a00078bffc5004f5c [file] [log] [blame]
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +00001// Copyright 2021 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package bp2build
16
17import (
18 "testing"
19
20 "android/soong/android"
21 "android/soong/cc"
22)
23
24const (
25 // See cc/testing.go for more context
26 // TODO(alexmarquez): Split out the preamble into common code?
27 soongCcLibrarySharedPreamble = soongCcLibraryStaticPreamble
28)
29
30func registerCcLibrarySharedModuleTypes(ctx android.RegistrationContext) {
31 cc.RegisterCCBuildComponents(ctx)
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +000032 ctx.RegisterModuleType("cc_library_headers", cc.LibraryHeaderFactory)
33 ctx.RegisterModuleType("cc_library_static", cc.LibraryStaticFactory)
Liz Kammer12615db2021-09-28 09:19:17 -040034 ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +000035}
36
Sam Delmerico3177a6e2022-06-21 19:28:33 +000037func runCcLibrarySharedTestCase(t *testing.T, tc Bp2buildTestCase) {
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +000038 t.Helper()
Sam Delmerico3177a6e2022-06-21 19:28:33 +000039 (&tc).ModuleTypeUnderTest = "cc_library_shared"
40 (&tc).ModuleTypeUnderTestFactory = cc.LibrarySharedFactory
41 RunBp2BuildTestCase(t, registerCcLibrarySharedModuleTypes, tc)
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +000042}
43
44func TestCcLibrarySharedSimple(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +000045 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
46 Description: "cc_library_shared simple overall test",
47 Filesystem: map[string]string{
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +000048 // NOTE: include_dir headers *should not* appear in Bazel hdrs later (?)
49 "include_dir_1/include_dir_1_a.h": "",
50 "include_dir_1/include_dir_1_b.h": "",
51 "include_dir_2/include_dir_2_a.h": "",
52 "include_dir_2/include_dir_2_b.h": "",
53 // NOTE: local_include_dir headers *should not* appear in Bazel hdrs later (?)
54 "local_include_dir_1/local_include_dir_1_a.h": "",
55 "local_include_dir_1/local_include_dir_1_b.h": "",
56 "local_include_dir_2/local_include_dir_2_a.h": "",
57 "local_include_dir_2/local_include_dir_2_b.h": "",
58 // NOTE: export_include_dir headers *should* appear in Bazel hdrs later
59 "export_include_dir_1/export_include_dir_1_a.h": "",
60 "export_include_dir_1/export_include_dir_1_b.h": "",
61 "export_include_dir_2/export_include_dir_2_a.h": "",
62 "export_include_dir_2/export_include_dir_2_b.h": "",
63 // NOTE: Soong implicitly includes headers in the current directory
64 "implicit_include_1.h": "",
65 "implicit_include_2.h": "",
66 },
Sam Delmerico3177a6e2022-06-21 19:28:33 +000067 Blueprint: soongCcLibrarySharedPreamble + `
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +000068cc_library_headers {
69 name: "header_lib_1",
70 export_include_dirs: ["header_lib_1"],
71 bazel_module: { bp2build_available: false },
72}
73
74cc_library_headers {
75 name: "header_lib_2",
76 export_include_dirs: ["header_lib_2"],
77 bazel_module: { bp2build_available: false },
78}
79
80cc_library_shared {
81 name: "shared_lib_1",
82 srcs: ["shared_lib_1.cc"],
83 bazel_module: { bp2build_available: false },
84}
85
86cc_library_shared {
87 name: "shared_lib_2",
88 srcs: ["shared_lib_2.cc"],
89 bazel_module: { bp2build_available: false },
90}
91
92cc_library_static {
93 name: "whole_static_lib_1",
94 srcs: ["whole_static_lib_1.cc"],
95 bazel_module: { bp2build_available: false },
96}
97
98cc_library_static {
99 name: "whole_static_lib_2",
100 srcs: ["whole_static_lib_2.cc"],
101 bazel_module: { bp2build_available: false },
102}
103
104cc_library_shared {
105 name: "foo_shared",
106 srcs: [
107 "foo_shared1.cc",
108 "foo_shared2.cc",
109 ],
110 cflags: [
111 "-Dflag1",
112 "-Dflag2"
113 ],
114 shared_libs: [
115 "shared_lib_1",
116 "shared_lib_2"
117 ],
118 whole_static_libs: [
119 "whole_static_lib_1",
120 "whole_static_lib_2"
121 ],
122 include_dirs: [
123 "include_dir_1",
124 "include_dir_2",
125 ],
126 local_include_dirs: [
127 "local_include_dir_1",
128 "local_include_dir_2",
129 ],
130 export_include_dirs: [
131 "export_include_dir_1",
132 "export_include_dir_2"
133 ],
134 header_libs: [
135 "header_lib_1",
136 "header_lib_2"
137 ],
Yu Liufc603162022-03-01 15:44:08 -0800138 sdk_version: "current",
139 min_sdk_version: "29",
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000140
141 // TODO: Also support export_header_lib_headers
142}`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000143 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000144 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500145 "absolute_includes": `[
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000146 "include_dir_1",
147 "include_dir_2",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500148 ]`,
149 "copts": `[
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000150 "-Dflag1",
151 "-Dflag2",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500152 ]`,
153 "export_includes": `[
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000154 "export_include_dir_1",
155 "export_include_dir_2",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500156 ]`,
157 "implementation_deps": `[
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000158 ":header_lib_1",
159 ":header_lib_2",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500160 ]`,
161 "implementation_dynamic_deps": `[
Liz Kammer7a210ac2021-09-22 15:52:58 -0400162 ":shared_lib_1",
163 ":shared_lib_2",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500164 ]`,
165 "local_includes": `[
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000166 "local_include_dir_1",
167 "local_include_dir_2",
168 ".",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500169 ]`,
170 "srcs": `[
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000171 "foo_shared1.cc",
172 "foo_shared2.cc",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500173 ]`,
174 "whole_archive_deps": `[
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000175 ":whole_static_lib_1",
176 ":whole_static_lib_2",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500177 ]`,
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux126bd582022-04-21 15:19:27 +0000178 "sdk_version": `"current"`,
179 "min_sdk_version": `"29"`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500180 }),
181 },
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000182 })
183}
184
185func TestCcLibrarySharedArchSpecificSharedLib(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000186 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
187 Description: "cc_library_shared arch-specific shared_libs with whole_static_libs",
188 Filesystem: map[string]string{},
189 Blueprint: soongCcLibrarySharedPreamble + `
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000190cc_library_static {
191 name: "static_dep",
192 bazel_module: { bp2build_available: false },
193}
194cc_library_shared {
195 name: "shared_dep",
196 bazel_module: { bp2build_available: false },
197}
198cc_library_shared {
199 name: "foo_shared",
200 arch: { arm64: { shared_libs: ["shared_dep"], whole_static_libs: ["static_dep"] } },
201 include_build_directory: false,
202}`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000203 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000204 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500205 "implementation_dynamic_deps": `select({
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000206 "//build/bazel/platforms/arch:arm64": [":shared_dep"],
207 "//conditions:default": [],
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500208 })`,
209 "whole_archive_deps": `select({
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000210 "//build/bazel/platforms/arch:arm64": [":static_dep"],
211 "//conditions:default": [],
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500212 })`,
213 }),
214 },
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000215 })
216}
217
218func TestCcLibrarySharedOsSpecificSharedLib(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000219 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
220 Description: "cc_library_shared os-specific shared_libs",
221 Filesystem: map[string]string{},
222 Blueprint: soongCcLibrarySharedPreamble + `
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000223cc_library_shared {
224 name: "shared_dep",
225 bazel_module: { bp2build_available: false },
226}
227cc_library_shared {
228 name: "foo_shared",
229 target: { android: { shared_libs: ["shared_dep"], } },
230 include_build_directory: false,
231}`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000232 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000233 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500234 "implementation_dynamic_deps": `select({
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000235 "//build/bazel/platforms/os:android": [":shared_dep"],
236 "//conditions:default": [],
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500237 })`,
238 }),
239 },
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000240 })
241}
242
243func TestCcLibrarySharedBaseArchOsSpecificSharedLib(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000244 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
245 Description: "cc_library_shared base, arch, and os-specific shared_libs",
246 Filesystem: map[string]string{},
247 Blueprint: soongCcLibrarySharedPreamble + `
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000248cc_library_shared {
249 name: "shared_dep",
250 bazel_module: { bp2build_available: false },
251}
252cc_library_shared {
253 name: "shared_dep2",
254 bazel_module: { bp2build_available: false },
255}
256cc_library_shared {
257 name: "shared_dep3",
258 bazel_module: { bp2build_available: false },
259}
260cc_library_shared {
261 name: "foo_shared",
262 shared_libs: ["shared_dep"],
263 target: { android: { shared_libs: ["shared_dep2"] } },
264 arch: { arm64: { shared_libs: ["shared_dep3"] } },
265 include_build_directory: false,
266}`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000267 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000268 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500269 "implementation_dynamic_deps": `[":shared_dep"] + select({
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000270 "//build/bazel/platforms/arch:arm64": [":shared_dep3"],
271 "//conditions:default": [],
272 }) + select({
273 "//build/bazel/platforms/os:android": [":shared_dep2"],
274 "//conditions:default": [],
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500275 })`,
276 }),
277 },
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000278 })
279}
280
281func TestCcLibrarySharedSimpleExcludeSrcs(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000282 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
283 Description: "cc_library_shared simple exclude_srcs",
284 Filesystem: map[string]string{
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000285 "common.c": "",
286 "foo-a.c": "",
287 "foo-excluded.c": "",
288 },
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000289 Blueprint: soongCcLibrarySharedPreamble + `
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000290cc_library_shared {
291 name: "foo_shared",
292 srcs: ["common.c", "foo-*.c"],
293 exclude_srcs: ["foo-excluded.c"],
294 include_build_directory: false,
295}`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000296 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000297 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500298 "srcs_c": `[
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000299 "common.c",
300 "foo-a.c",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500301 ]`,
302 }),
303 },
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000304 })
305}
306
307func TestCcLibrarySharedStrip(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000308 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
309 Description: "cc_library_shared stripping",
310 Filesystem: map[string]string{},
311 Blueprint: soongCcLibrarySharedPreamble + `
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000312cc_library_shared {
313 name: "foo_shared",
314 strip: {
315 keep_symbols: false,
316 keep_symbols_and_debug_frame: true,
317 keep_symbols_list: ["sym", "sym2"],
318 all: true,
319 none: false,
320 },
321 include_build_directory: false,
322}`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000323 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000324 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500325 "strip": `{
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000326 "all": True,
327 "keep_symbols": False,
328 "keep_symbols_and_debug_frame": True,
329 "keep_symbols_list": [
330 "sym",
331 "sym2",
332 ],
333 "none": False,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500334 }`,
335 }),
336 },
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000337 })
338}
339
Trevor Radcliffe37ec2f72022-09-27 01:46:01 +0000340func TestCcLibrarySharedVersionScriptAndDynamicList(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000341 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
Trevor Radcliffe37ec2f72022-09-27 01:46:01 +0000342 Description: "cc_library_shared version script and dynamic list",
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000343 Filesystem: map[string]string{
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000344 "version_script": "",
Trevor Radcliffe37ec2f72022-09-27 01:46:01 +0000345 "dynamic.list": "",
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000346 },
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000347 Blueprint: soongCcLibrarySharedPreamble + `
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000348cc_library_shared {
349 name: "foo_shared",
350 version_script: "version_script",
Trevor Radcliffe37ec2f72022-09-27 01:46:01 +0000351 dynamic_list: "dynamic.list",
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000352 include_build_directory: false,
353}`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000354 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000355 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
Trevor Radcliffe37ec2f72022-09-27 01:46:01 +0000356 "additional_linker_inputs": `[
357 "version_script",
358 "dynamic.list",
359 ]`,
360 "linkopts": `[
361 "-Wl,--version-script,$(location version_script)",
362 "-Wl,--dynamic-list,$(location dynamic.list)",
363 ]`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500364 }),
365 },
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxac5097f2021-09-01 21:22:09 +0000366 })
367}
Jingwen Chen6ada5892021-09-17 11:38:09 +0000368
Trevor Radcliffeea6a45d2022-09-20 18:58:01 +0000369func TestCcLibraryLdflagsSplitBySpaceSoongAdded(t *testing.T) {
370 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
371 Description: "ldflags are split by spaces except for the ones added by soong (version script and dynamic list)",
372 Filesystem: map[string]string{
373 "version_script": "",
374 "dynamic.list": "",
375 },
376 Blueprint: `
377cc_library_shared {
378 name: "foo",
379 ldflags: [
380 "--nospace_flag",
381 "-z spaceflag",
382 ],
383 version_script: "version_script",
384 dynamic_list: "dynamic.list",
385 include_build_directory: false,
386}`,
387 ExpectedBazelTargets: []string{
388 MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
389 "additional_linker_inputs": `[
390 "version_script",
391 "dynamic.list",
392 ]`,
393 "linkopts": `[
394 "--nospace_flag",
395 "-z",
396 "spaceflag",
397 "-Wl,--version-script,$(location version_script)",
398 "-Wl,--dynamic-list,$(location dynamic.list)",
399 ]`,
400 }),
401 },
402 })
403}
404
Jingwen Chen6ada5892021-09-17 11:38:09 +0000405func TestCcLibrarySharedNoCrtTrue(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000406 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
Alex Márquez Pérez Muñíz Díaz Puras Thaureaux01ec55e2023-01-30 22:53:04 +0000407 Description: "cc_library_shared - nocrt: true disables feature",
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000408 Filesystem: map[string]string{
Jingwen Chen6ada5892021-09-17 11:38:09 +0000409 "impl.cpp": "",
410 },
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000411 Blueprint: soongCcLibraryPreamble + `
Jingwen Chen6ada5892021-09-17 11:38:09 +0000412cc_library_shared {
413 name: "foo_shared",
414 srcs: ["impl.cpp"],
415 nocrt: true,
416 include_build_directory: false,
417}
418`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000419 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000420 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
Alex Márquez Pérez Muñíz Díaz Puras Thaureaux01ec55e2023-01-30 22:53:04 +0000421 "features": `["-link_crt"]`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500422 "srcs": `["impl.cpp"]`,
423 }),
424 },
425 })
Jingwen Chen6ada5892021-09-17 11:38:09 +0000426}
427
428func TestCcLibrarySharedNoCrtFalse(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000429 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
Alex Márquez Pérez Muñíz Díaz Puras Thaureaux01ec55e2023-01-30 22:53:04 +0000430 Description: "cc_library_shared - nocrt: false doesn't disable feature",
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000431 Filesystem: map[string]string{
Jingwen Chen6ada5892021-09-17 11:38:09 +0000432 "impl.cpp": "",
433 },
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000434 Blueprint: soongCcLibraryPreamble + `
Jingwen Chen6ada5892021-09-17 11:38:09 +0000435cc_library_shared {
436 name: "foo_shared",
437 srcs: ["impl.cpp"],
438 nocrt: false,
439 include_build_directory: false,
440}
441`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000442 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000443 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500444 "srcs": `["impl.cpp"]`,
445 }),
446 },
447 })
Jingwen Chen6ada5892021-09-17 11:38:09 +0000448}
449
450func TestCcLibrarySharedNoCrtArchVariant(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000451 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
452 Description: "cc_library_shared - nocrt in select",
453 Filesystem: map[string]string{
Jingwen Chen6ada5892021-09-17 11:38:09 +0000454 "impl.cpp": "",
455 },
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000456 Blueprint: soongCcLibraryPreamble + `
Jingwen Chen6ada5892021-09-17 11:38:09 +0000457cc_library_shared {
458 name: "foo_shared",
459 srcs: ["impl.cpp"],
460 arch: {
461 arm: {
462 nocrt: true,
463 },
464 x86: {
465 nocrt: false,
466 },
467 },
468 include_build_directory: false,
469}
470`,
Alex Márquez Pérez Muñíz Díaz Puras Thaureaux01ec55e2023-01-30 22:53:04 +0000471 ExpectedBazelTargets: []string{
472 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
473 "features": `select({
474 "//build/bazel/platforms/arch:arm": ["-link_crt"],
475 "//conditions:default": [],
476 })`,
477 "srcs": `["impl.cpp"]`,
478 }),
479 },
Jingwen Chen6ada5892021-09-17 11:38:09 +0000480 })
481}
Liz Kammer12615db2021-09-28 09:19:17 -0400482
483func TestCcLibrarySharedProto(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000484 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
485 Blueprint: soongCcProtoPreamble + `cc_library_shared {
Liz Kammer12615db2021-09-28 09:19:17 -0400486 name: "foo",
487 srcs: ["foo.proto"],
488 proto: {
Liz Kammer12615db2021-09-28 09:19:17 -0400489 export_proto_headers: true,
490 },
491 include_build_directory: false,
492}`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000493 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000494 MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
Liz Kammer12615db2021-09-28 09:19:17 -0400495 "srcs": `["foo.proto"]`,
Alixe06d75b2022-08-31 18:28:19 +0000496 }), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
Liz Kammer12615db2021-09-28 09:19:17 -0400497 "deps": `[":foo_proto"]`,
Alixe06d75b2022-08-31 18:28:19 +0000498 }), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
Liz Kammer12615db2021-09-28 09:19:17 -0400499 "dynamic_deps": `[":libprotobuf-cpp-lite"]`,
500 "whole_archive_deps": `[":foo_cc_proto_lite"]`,
501 }),
502 },
503 })
504}
Rupert Shuttleworth484aa252021-12-10 07:22:53 -0500505
506func TestCcLibrarySharedUseVersionLib(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000507 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
Liz Kammerbaced712022-09-16 09:01:29 -0400508 Filesystem: map[string]string{
509 soongCcVersionLibBpPath: soongCcVersionLibBp,
510 },
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000511 Blueprint: soongCcProtoPreamble + `cc_library_shared {
Rupert Shuttleworth484aa252021-12-10 07:22:53 -0500512 name: "foo",
513 use_version_lib: true,
514 include_build_directory: false,
515}`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000516 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000517 MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
Liz Kammerbaced712022-09-16 09:01:29 -0400518 "use_version_lib": "True",
519 "implementation_whole_archive_deps": `["//build/soong/cc/libbuildversion:libbuildversion"]`,
Rupert Shuttleworth484aa252021-12-10 07:22:53 -0500520 }),
521 },
522 })
523}
Jingwen Chen0ee88a62022-01-07 14:55:29 +0000524
525func TestCcLibrarySharedStubs(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000526 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
527 Description: "cc_library_shared stubs",
528 ModuleTypeUnderTest: "cc_library_shared",
529 ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
530 Dir: "foo/bar",
531 Filesystem: map[string]string{
Jingwen Chen0ee88a62022-01-07 14:55:29 +0000532 "foo/bar/Android.bp": `
533cc_library_shared {
534 name: "a",
535 stubs: { symbol_file: "a.map.txt", versions: ["28", "29", "current"] },
536 bazel_module: { bp2build_available: true },
537 include_build_directory: false,
538}
539`,
540 },
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000541 Blueprint: soongCcLibraryPreamble,
Trevor Radcliffef19d8a72022-09-20 23:04:39 +0000542 ExpectedBazelTargets: []string{makeCcStubSuiteTargets("a", AttrNameToString{
543 "soname": `"a.so"`,
544 "source_library": `":a"`,
545 "stubs_symbol_file": `"a.map.txt"`,
546 "stubs_versions": `[
Trevor Radcliffe087af542022-09-16 15:36:10 +0000547 "28",
548 "29",
549 "current",
550 ]`,
Trevor Radcliffef19d8a72022-09-20 23:04:39 +0000551 }),
552 MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
Yu Liu56ccb1a2022-11-12 10:47:07 -0800553 "stubs_symbol_file": `"a.map.txt"`,
Trevor Radcliffe087af542022-09-16 15:36:10 +0000554 }),
Jingwen Chen0ee88a62022-01-07 14:55:29 +0000555 },
Trevor Radcliffef19d8a72022-09-20 23:04:39 +0000556 })
Jingwen Chen0ee88a62022-01-07 14:55:29 +0000557}
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux126bd582022-04-21 15:19:27 +0000558
559func TestCcLibrarySharedSystemSharedLibsSharedEmpty(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000560 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
561 Description: "cc_library_shared system_shared_libs empty shared default",
562 ModuleTypeUnderTest: "cc_library_shared",
563 ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
564 Blueprint: soongCcLibrarySharedPreamble + `
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux126bd582022-04-21 15:19:27 +0000565cc_defaults {
566 name: "empty_defaults",
567 shared: {
568 system_shared_libs: [],
569 },
570 include_build_directory: false,
571}
572cc_library_shared {
573 name: "empty",
574 defaults: ["empty_defaults"],
575}
576`,
Alixe06d75b2022-08-31 18:28:19 +0000577 ExpectedBazelTargets: []string{MakeBazelTarget("cc_library_shared", "empty", AttrNameToString{
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux126bd582022-04-21 15:19:27 +0000578 "system_dynamic_deps": "[]",
579 })},
580 })
581}
Trevor Radcliffeef9c9002022-05-13 20:55:35 +0000582
583func TestCcLibrarySharedConvertLex(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000584 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
585 Description: "cc_library_shared with lex files",
586 ModuleTypeUnderTest: "cc_library_shared",
587 ModuleTypeUnderTestFactory: cc.LibrarySharedFactory,
588 Filesystem: map[string]string{
Trevor Radcliffeef9c9002022-05-13 20:55:35 +0000589 "foo.c": "",
590 "bar.cc": "",
591 "foo1.l": "",
592 "bar1.ll": "",
593 "foo2.l": "",
594 "bar2.ll": "",
595 },
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000596 Blueprint: `cc_library_shared {
Trevor Radcliffeef9c9002022-05-13 20:55:35 +0000597 name: "foo_lib",
598 srcs: ["foo.c", "bar.cc", "foo1.l", "foo2.l", "bar1.ll", "bar2.ll"],
599 lex: { flags: ["--foo_flags"] },
600 include_build_directory: false,
601 bazel_module: { bp2build_available: true },
602}`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000603 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000604 MakeBazelTarget("genlex", "foo_lib_genlex_l", AttrNameToString{
Trevor Radcliffeef9c9002022-05-13 20:55:35 +0000605 "srcs": `[
606 "foo1.l",
607 "foo2.l",
608 ]`,
609 "lexopts": `["--foo_flags"]`,
610 }),
Alixe06d75b2022-08-31 18:28:19 +0000611 MakeBazelTarget("genlex", "foo_lib_genlex_ll", AttrNameToString{
Trevor Radcliffeef9c9002022-05-13 20:55:35 +0000612 "srcs": `[
613 "bar1.ll",
614 "bar2.ll",
615 ]`,
616 "lexopts": `["--foo_flags"]`,
617 }),
Alixe06d75b2022-08-31 18:28:19 +0000618 MakeBazelTarget("cc_library_shared", "foo_lib", AttrNameToString{
Trevor Radcliffeef9c9002022-05-13 20:55:35 +0000619 "srcs": `[
620 "bar.cc",
621 ":foo_lib_genlex_ll",
622 ]`,
623 "srcs_c": `[
624 "foo.c",
625 ":foo_lib_genlex_l",
626 ]`,
627 }),
628 },
629 })
630}
Alix1be00d42022-05-16 22:56:04 +0000631
632func TestCcLibrarySharedClangUnknownFlags(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000633 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
634 Blueprint: soongCcProtoPreamble + `cc_library_shared {
Alix1be00d42022-05-16 22:56:04 +0000635 name: "foo",
636 conlyflags: ["-a", "-finline-functions"],
637 cflags: ["-b","-finline-functions"],
638 cppflags: ["-c", "-finline-functions"],
639 ldflags: ["-d","-finline-functions", "-e"],
640 include_build_directory: false,
641}`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000642 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000643 MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
Alix1be00d42022-05-16 22:56:04 +0000644 "conlyflags": `["-a"]`,
645 "copts": `["-b"]`,
646 "cppflags": `["-c"]`,
647 "linkopts": `[
648 "-d",
649 "-e",
650 ]`,
651 }),
652 },
653 })
654}
655
656func TestCCLibraryFlagSpaceSplitting(t *testing.T) {
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000657 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
658 Blueprint: soongCcProtoPreamble + `cc_library_shared {
Alix1be00d42022-05-16 22:56:04 +0000659 name: "foo",
660 conlyflags: [ "-include header.h"],
661 cflags: ["-include header.h"],
662 cppflags: ["-include header.h"],
663 version_script: "version_script",
664 include_build_directory: false,
665}`,
Sam Delmerico3177a6e2022-06-21 19:28:33 +0000666 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000667 MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
Alix1be00d42022-05-16 22:56:04 +0000668 "additional_linker_inputs": `["version_script"]`,
669 "conlyflags": `[
670 "-include",
671 "header.h",
672 ]`,
673 "copts": `[
674 "-include",
675 "header.h",
676 ]`,
677 "cppflags": `[
678 "-include",
679 "header.h",
680 ]`,
681 "linkopts": `["-Wl,--version-script,$(location version_script)"]`,
682 }),
683 },
684 })
685}
Cole Faust6b29f592022-08-09 09:50:56 -0700686
687func TestCCLibrarySharedRuntimeDeps(t *testing.T) {
688 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
689 Blueprint: `cc_library_shared {
690 name: "bar",
691}
692
693cc_library_shared {
694 name: "foo",
695 runtime_libs: ["foo"],
696}`,
697 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000698 MakeBazelTarget("cc_library_shared", "bar", AttrNameToString{
Cole Faust6b29f592022-08-09 09:50:56 -0700699 "local_includes": `["."]`,
700 }),
Alixe06d75b2022-08-31 18:28:19 +0000701 MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
Cole Faust6b29f592022-08-09 09:50:56 -0700702 "runtime_deps": `[":foo"]`,
703 "local_includes": `["."]`,
704 }),
705 },
706 })
707}
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxa56e9702022-02-23 18:39:59 -0500708
709func TestCcLibrarySharedEmptySuffix(t *testing.T) {
710 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
711 Description: "cc_library_shared with empty suffix",
712 Filesystem: map[string]string{
713 "foo.c": "",
714 },
715 Blueprint: soongCcLibrarySharedPreamble + `
716cc_library_shared {
717 name: "foo_shared",
718 suffix: "",
719 srcs: ["foo.c"],
720 include_build_directory: false,
721}`,
722 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000723 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxa56e9702022-02-23 18:39:59 -0500724 "srcs_c": `["foo.c"]`,
725 "suffix": `""`,
726 }),
727 },
728 })
729}
730
731func TestCcLibrarySharedSuffix(t *testing.T) {
732 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
733 Description: "cc_library_shared with suffix",
734 Filesystem: map[string]string{
735 "foo.c": "",
736 },
737 Blueprint: soongCcLibrarySharedPreamble + `
738cc_library_shared {
739 name: "foo_shared",
740 suffix: "-suf",
741 srcs: ["foo.c"],
742 include_build_directory: false,
743}`,
744 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000745 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxa56e9702022-02-23 18:39:59 -0500746 "srcs_c": `["foo.c"]`,
747 "suffix": `"-suf"`,
748 }),
749 },
750 })
751}
752
753func TestCcLibrarySharedArchVariantSuffix(t *testing.T) {
754 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
755 Description: "cc_library_shared with arch-variant suffix",
756 Filesystem: map[string]string{
757 "foo.c": "",
758 },
759 Blueprint: soongCcLibrarySharedPreamble + `
760cc_library_shared {
761 name: "foo_shared",
762 arch: {
763 arm64: { suffix: "-64" },
764 arm: { suffix: "-32" },
765 },
766 srcs: ["foo.c"],
767 include_build_directory: false,
768}`,
769 ExpectedBazelTargets: []string{
Alixe06d75b2022-08-31 18:28:19 +0000770 MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxa56e9702022-02-23 18:39:59 -0500771 "srcs_c": `["foo.c"]`,
772 "suffix": `select({
773 "//build/bazel/platforms/arch:arm": "-32",
774 "//build/bazel/platforms/arch:arm64": "-64",
775 "//conditions:default": None,
776 })`,
777 }),
778 },
779 })
780}
Trevor Radcliffecee4e052022-09-06 19:31:25 +0000781
782func TestCcLibrarySharedWithSyspropSrcs(t *testing.T) {
783 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
784 Description: "cc_library_shared with sysprop sources",
785 Blueprint: `
786cc_library_shared {
787 name: "foo",
788 srcs: [
789 "bar.sysprop",
790 "baz.sysprop",
791 "blah.cpp",
792 ],
793 min_sdk_version: "5",
794}`,
795 ExpectedBazelTargets: []string{
796 MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
797 "srcs": `[
798 "bar.sysprop",
799 "baz.sysprop",
800 ]`,
801 }),
802 MakeBazelTarget("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
803 "dep": `":foo_sysprop_library"`,
804 "min_sdk_version": `"5"`,
805 }),
806 MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
807 "srcs": `["blah.cpp"]`,
808 "local_includes": `["."]`,
809 "min_sdk_version": `"5"`,
810 "whole_archive_deps": `[":foo_cc_sysprop_library_static"]`,
811 }),
812 },
813 })
814}
815
816func TestCcLibrarySharedWithSyspropSrcsSomeConfigs(t *testing.T) {
817 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
818 Description: "cc_library_shared with sysprop sources in some configs but not others",
819 Blueprint: `
820cc_library_shared {
821 name: "foo",
822 srcs: [
823 "blah.cpp",
824 ],
825 target: {
826 android: {
827 srcs: ["bar.sysprop"],
828 },
829 },
830 min_sdk_version: "5",
831}`,
832 ExpectedBazelTargets: []string{
833 MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
834 "srcs": `select({
835 "//build/bazel/platforms/os:android": ["bar.sysprop"],
836 "//conditions:default": [],
837 })`,
838 }),
839 MakeBazelTarget("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
840 "dep": `":foo_sysprop_library"`,
841 "min_sdk_version": `"5"`,
842 }),
843 MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
844 "srcs": `["blah.cpp"]`,
845 "local_includes": `["."]`,
846 "min_sdk_version": `"5"`,
847 "whole_archive_deps": `select({
848 "//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
849 "//conditions:default": [],
850 })`,
851 }),
852 },
853 })
854}
Yu Liu56ccb1a2022-11-12 10:47:07 -0800855
856func TestCcLibrarySharedHeaderAbiChecker(t *testing.T) {
857 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
858 Description: "cc_library_shared with header abi checker",
859 Blueprint: `cc_library_shared {
860 name: "foo",
861 header_abi_checker: {
862 enabled: true,
863 symbol_file: "a.map.txt",
864 exclude_symbol_versions: [
865 "29",
866 "30",
867 ],
868 exclude_symbol_tags: [
869 "tag1",
870 "tag2",
871 ],
872 check_all_apis: true,
873 diff_flags: ["-allow-adding-removing-weak-symbols"],
874 },
875 include_build_directory: false,
876}`,
877 ExpectedBazelTargets: []string{
878 MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
879 "abi_checker_enabled": `True`,
880 "abi_checker_symbol_file": `"a.map.txt"`,
881 "abi_checker_exclude_symbol_versions": `[
882 "29",
883 "30",
884 ]`,
885 "abi_checker_exclude_symbol_tags": `[
886 "tag1",
887 "tag2",
888 ]`,
889 "abi_checker_check_all_apis": `True`,
890 "abi_checker_diff_flags": `["-allow-adding-removing-weak-symbols"]`,
891 }),
892 },
893 })
894}
Trevor Radcliffedb7e0262022-10-28 16:48:18 +0000895
896func TestCcLibrarySharedWithIntegerOverflowProperty(t *testing.T) {
897 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
898 Description: "cc_library_shared has correct features when integer_overflow property is provided",
899 Blueprint: `
900cc_library_shared {
901 name: "foo",
902 sanitize: {
903 integer_overflow: true,
904 },
905}
906`,
907 ExpectedBazelTargets: []string{
908 MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
909 "features": `["ubsan_integer_overflow"]`,
910 "local_includes": `["."]`,
911 }),
912 },
913 })
914}
915
916func TestCcLibrarySharedWithMiscUndefinedProperty(t *testing.T) {
917 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
918 Description: "cc_library_shared has correct features when misc_undefined property is provided",
919 Blueprint: `
920cc_library_shared {
921 name: "foo",
922 sanitize: {
923 misc_undefined: ["undefined", "nullability"],
924 },
925}
926`,
927 ExpectedBazelTargets: []string{
928 MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
929 "features": `[
930 "ubsan_undefined",
931 "ubsan_nullability",
932 ]`,
933 "local_includes": `["."]`,
934 }),
935 },
936 })
937}
938
939func TestCcLibrarySharedWithUBSanPropertiesArchSpecific(t *testing.T) {
940 runCcLibrarySharedTestCase(t, Bp2buildTestCase{
941 Description: "cc_library_shared has correct feature select when UBSan props are specified in arch specific blocks",
942 Blueprint: `
943cc_library_shared {
944 name: "foo",
945 sanitize: {
946 misc_undefined: ["undefined", "nullability"],
947 },
948 target: {
949 android: {
950 sanitize: {
951 misc_undefined: ["alignment"],
952 },
953 },
954 linux_glibc: {
955 sanitize: {
956 integer_overflow: true,
957 },
958 },
959 },
960}
961`,
962 ExpectedBazelTargets: []string{
963 MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
964 "features": `[
965 "ubsan_undefined",
966 "ubsan_nullability",
967 ] + select({
968 "//build/bazel/platforms/os:android": ["ubsan_alignment"],
969 "//build/bazel/platforms/os:linux_glibc": ["ubsan_integer_overflow"],
970 "//conditions:default": [],
971 })`,
972 "local_includes": `["."]`,
973 }),
974 },
975 })
976}