Support building libcrypto via mixed builds am: a37e195182
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1839353 Change-Id: I34a5ec794874856a415e2c5415ef8b08ef3a7e21
This commit is contained in:
58
cc/object.go
58
cc/object.go
@@ -122,14 +122,17 @@ func ObjectFactory() android.Module {
|
||||
|
||||
// For bp2build conversion.
|
||||
type bazelObjectAttributes struct {
|
||||
Srcs bazel.LabelListAttribute
|
||||
Srcs_as bazel.LabelListAttribute
|
||||
Hdrs bazel.LabelListAttribute
|
||||
Deps bazel.LabelListAttribute
|
||||
Copts bazel.StringListAttribute
|
||||
Asflags bazel.StringListAttribute
|
||||
Local_includes bazel.StringListAttribute
|
||||
Absolute_includes bazel.StringListAttribute
|
||||
Srcs bazel.LabelListAttribute
|
||||
Srcs_as bazel.LabelListAttribute
|
||||
Hdrs bazel.LabelListAttribute
|
||||
Deps bazel.LabelListAttribute
|
||||
System_dynamic_deps bazel.LabelListAttribute
|
||||
Copts bazel.StringListAttribute
|
||||
Asflags bazel.StringListAttribute
|
||||
Local_includes bazel.StringListAttribute
|
||||
Absolute_includes bazel.StringListAttribute
|
||||
Stl *string
|
||||
Linker_script bazel.LabelAttribute
|
||||
}
|
||||
|
||||
// ObjectBp2Build is the bp2build converter from cc_object modules to the
|
||||
@@ -153,12 +156,26 @@ func ObjectBp2Build(ctx android.TopDownMutatorContext) {
|
||||
// Set arch-specific configurable attributes
|
||||
compilerAttrs := bp2BuildParseCompilerProps(ctx, m)
|
||||
var deps bazel.LabelListAttribute
|
||||
for _, props := range m.linker.linkerProps() {
|
||||
if objectLinkerProps, ok := props.(*ObjectLinkerProperties); ok {
|
||||
deps = bazel.MakeLabelListAttribute(
|
||||
android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Objs))
|
||||
systemDynamicDeps := bazel.LabelListAttribute{ForceSpecifyEmptyList: true}
|
||||
|
||||
var linkerScript bazel.LabelAttribute
|
||||
|
||||
for axis, configToProps := range m.GetArchVariantProperties(ctx, &ObjectLinkerProperties{}) {
|
||||
for config, props := range configToProps {
|
||||
if objectLinkerProps, ok := props.(*ObjectLinkerProperties); ok {
|
||||
if objectLinkerProps.Linker_script != nil {
|
||||
linkerScript.SetSelectValue(axis, config, android.BazelLabelForModuleSrcSingle(ctx, *objectLinkerProps.Linker_script))
|
||||
}
|
||||
deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Objs))
|
||||
systemSharedLibs := objectLinkerProps.System_shared_libs
|
||||
if len(systemSharedLibs) > 0 {
|
||||
systemSharedLibs = android.FirstUniqueStrings(systemSharedLibs)
|
||||
}
|
||||
systemDynamicDeps.SetSelectValue(axis, config, bazelLabelForSharedDeps(ctx, systemSharedLibs))
|
||||
}
|
||||
}
|
||||
}
|
||||
deps.ResolveExcludes()
|
||||
|
||||
// Don't split cc_object srcs across languages. Doing so would add complexity,
|
||||
// and this isn't typically done for cc_object.
|
||||
@@ -172,13 +189,16 @@ func ObjectBp2Build(ctx android.TopDownMutatorContext) {
|
||||
}
|
||||
|
||||
attrs := &bazelObjectAttributes{
|
||||
Srcs: srcs,
|
||||
Srcs_as: compilerAttrs.asSrcs,
|
||||
Deps: deps,
|
||||
Copts: compilerAttrs.copts,
|
||||
Asflags: asFlags,
|
||||
Local_includes: compilerAttrs.localIncludes,
|
||||
Absolute_includes: compilerAttrs.absoluteIncludes,
|
||||
Srcs: srcs,
|
||||
Srcs_as: compilerAttrs.asSrcs,
|
||||
Deps: deps,
|
||||
System_dynamic_deps: systemDynamicDeps,
|
||||
Copts: compilerAttrs.copts,
|
||||
Asflags: asFlags,
|
||||
Local_includes: compilerAttrs.localIncludes,
|
||||
Absolute_includes: compilerAttrs.absoluteIncludes,
|
||||
Stl: compilerAttrs.stl,
|
||||
Linker_script: linkerScript,
|
||||
}
|
||||
|
||||
props := bazel.BazelTargetModuleProperties{
|
||||
|
Reference in New Issue
Block a user