Add `data_libs` property to cc_test rules
This allows dependencies on link:shared variant of library modules, and
adds the shared libraries adjacent to the test binary
Test: Manually verified on bionic-unit-tests target
Change-Id: I5d406bf9428664c5ac3d3c5915507b750375debb
diff --git a/cc/cc.go b/cc/cc.go
index e52adaf..0d5b6bd 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -96,6 +96,9 @@
HeaderLibs []string
RuntimeLibs []string
+ // Used for data dependencies adjacent to tests
+ DataLibs []string
+
StaticUnwinderIfLegacy bool
ReexportSharedLibHeaders, ReexportStaticLibHeaders, ReexportHeaderLibHeaders []string
@@ -423,6 +426,7 @@
}
var (
+ dataLibDepTag = DependencyTag{Name: "data_lib", Library: true, Shared: true}
sharedExportDepTag = DependencyTag{Name: "shared", Library: true, Shared: true, ReexportFlags: true}
earlySharedDepTag = DependencyTag{Name: "early_shared", Library: true, Shared: true}
lateSharedDepTag = DependencyTag{Name: "late shared", Library: true, Shared: true}
@@ -1982,6 +1986,10 @@
actx.AddVariationDependencies([]blueprint.Variation{
{Mutator: "link", Variation: "shared"},
+ }, dataLibDepTag, deps.DataLibs...)
+
+ actx.AddVariationDependencies([]blueprint.Variation{
+ {Mutator: "link", Variation: "shared"},
}, runtimeDepTag, deps.RuntimeLibs...)
actx.AddDependency(c, genSourceDepTag, deps.GeneratedSources...)