Merge "Bp2build support for runtime_libs"

This commit is contained in:
Cole Faust
2022-08-19 20:09:56 +00:00
committed by Gerrit Code Review
8 changed files with 125 additions and 5 deletions

View File

@@ -617,6 +617,7 @@ func binaryBp2build(ctx android.TopDownMutatorContext, m *Module, typ string) {
Dynamic_deps: baseAttrs.implementationDynamicDeps,
Whole_archive_deps: baseAttrs.wholeArchiveDeps,
System_deps: baseAttrs.systemDynamicDeps,
Runtime_deps: baseAttrs.runtimeDeps,
Local_includes: baseAttrs.localIncludes,
Absolute_includes: baseAttrs.absoluteIncludes,
@@ -667,6 +668,7 @@ type binaryAttributes struct {
Dynamic_deps bazel.LabelListAttribute
Whole_archive_deps bazel.LabelListAttribute
System_deps bazel.LabelListAttribute
Runtime_deps bazel.LabelListAttribute
Local_includes bazel.StringListAttribute
Absolute_includes bazel.StringListAttribute

View File

@@ -52,6 +52,7 @@ type staticOrSharedAttributes struct {
Implementation_dynamic_deps bazel.LabelListAttribute
Whole_archive_deps bazel.LabelListAttribute
Implementation_whole_archive_deps bazel.LabelListAttribute
Runtime_deps bazel.LabelListAttribute
System_dynamic_deps bazel.LabelListAttribute
@@ -710,6 +711,7 @@ type linkerAttributes struct {
implementationDeps bazel.LabelListAttribute
dynamicDeps bazel.LabelListAttribute
implementationDynamicDeps bazel.LabelListAttribute
runtimeDeps bazel.LabelListAttribute
wholeArchiveDeps bazel.LabelListAttribute
implementationWholeArchiveDeps bazel.LabelListAttribute
systemDynamicDeps bazel.LabelListAttribute
@@ -825,6 +827,11 @@ func (la *linkerAttributes) bp2buildForAxisAndConfig(ctx android.BazelConversion
if axisFeatures != nil {
la.features.SetSelectValue(axis, config, axisFeatures)
}
runtimeDeps := android.BazelLabelForModuleDepsExcludes(ctx, props.Runtime_libs, props.Exclude_runtime_libs)
if !runtimeDeps.IsEmpty() {
la.runtimeDeps.SetSelectValue(axis, config, runtimeDeps)
}
}
func (la *linkerAttributes) convertStripProps(ctx android.BazelConversionPathContext, module *Module) {

View File

@@ -319,6 +319,7 @@ func libraryBp2Build(ctx android.TopDownMutatorContext, m *Module) {
Implementation_whole_archive_deps: linkerAttrs.implementationWholeArchiveDeps,
Whole_archive_deps: *linkerAttrs.wholeArchiveDeps.Clone().Append(staticAttrs.Whole_archive_deps),
System_dynamic_deps: *linkerAttrs.systemDynamicDeps.Clone().Append(staticAttrs.System_dynamic_deps),
Runtime_deps: linkerAttrs.runtimeDeps,
sdkAttributes: bp2BuildParseSdkAttributes(m),
}
@@ -335,6 +336,7 @@ func libraryBp2Build(ctx android.TopDownMutatorContext, m *Module) {
Implementation_dynamic_deps: *linkerAttrs.implementationDynamicDeps.Clone().Append(sharedAttrs.Implementation_dynamic_deps),
Whole_archive_deps: *linkerAttrs.wholeArchiveDeps.Clone().Append(sharedAttrs.Whole_archive_deps),
System_dynamic_deps: *linkerAttrs.systemDynamicDeps.Clone().Append(sharedAttrs.System_dynamic_deps),
Runtime_deps: linkerAttrs.runtimeDeps,
sdkAttributes: bp2BuildParseSdkAttributes(m),
}
@@ -2552,6 +2554,7 @@ func sharedOrStaticLibraryBp2Build(ctx android.TopDownMutatorContext, module *Mo
Implementation_whole_archive_deps: linkerAttrs.implementationWholeArchiveDeps,
System_dynamic_deps: linkerAttrs.systemDynamicDeps,
sdkAttributes: bp2BuildParseSdkAttributes(module),
Runtime_deps: linkerAttrs.runtimeDeps,
}
var attrs interface{}