|
@@ -28,14 +28,15 @@ import (
|
|
)
|
|
)
|
|
|
|
|
|
const (
|
|
const (
|
|
- cSrcPartition = "c"
|
|
|
|
- asSrcPartition = "as"
|
|
|
|
- asmSrcPartition = "asm"
|
|
|
|
- lSrcPartition = "l"
|
|
|
|
- llSrcPartition = "ll"
|
|
|
|
- cppSrcPartition = "cpp"
|
|
|
|
- protoSrcPartition = "proto"
|
|
|
|
- aidlSrcPartition = "aidl"
|
|
|
|
|
|
+ cSrcPartition = "c"
|
|
|
|
+ asSrcPartition = "as"
|
|
|
|
+ asmSrcPartition = "asm"
|
|
|
|
+ lSrcPartition = "l"
|
|
|
|
+ llSrcPartition = "ll"
|
|
|
|
+ cppSrcPartition = "cpp"
|
|
|
|
+ protoSrcPartition = "proto"
|
|
|
|
+ aidlSrcPartition = "aidl"
|
|
|
|
+ syspropSrcPartition = "sysprop"
|
|
|
|
|
|
stubsSuffix = "_stub_libs_current"
|
|
stubsSuffix = "_stub_libs_current"
|
|
)
|
|
)
|
|
@@ -104,7 +105,8 @@ func groupSrcsByExtension(ctx android.BazelConversionPathContext, srcs bazel.Lab
|
|
llSrcPartition: bazel.LabelPartition{Extensions: []string{".ll"}},
|
|
llSrcPartition: bazel.LabelPartition{Extensions: []string{".ll"}},
|
|
// C++ is the "catch-all" group, and comprises generated sources because we don't
|
|
// C++ is the "catch-all" group, and comprises generated sources because we don't
|
|
// know the language of these sources until the genrule is executed.
|
|
// know the language of these sources until the genrule is executed.
|
|
- cppSrcPartition: bazel.LabelPartition{Extensions: []string{".cpp", ".cc", ".cxx", ".mm"}, LabelMapper: addSuffixForFilegroup("_cpp_srcs"), Keep_remainder: true},
|
|
|
|
|
|
+ cppSrcPartition: bazel.LabelPartition{Extensions: []string{".cpp", ".cc", ".cxx", ".mm"}, LabelMapper: addSuffixForFilegroup("_cpp_srcs"), Keep_remainder: true},
|
|
|
|
+ syspropSrcPartition: bazel.LabelPartition{Extensions: []string{".sysprop"}},
|
|
}
|
|
}
|
|
|
|
|
|
return bazel.PartitionLabelListAttribute(ctx, &srcs, labels)
|
|
return bazel.PartitionLabelListAttribute(ctx, &srcs, labels)
|
|
@@ -320,6 +322,9 @@ type compilerAttributes struct {
|
|
llSrcs bazel.LabelListAttribute
|
|
llSrcs bazel.LabelListAttribute
|
|
lexopts bazel.StringListAttribute
|
|
lexopts bazel.StringListAttribute
|
|
|
|
|
|
|
|
+ // Sysprop sources
|
|
|
|
+ syspropSrcs bazel.LabelListAttribute
|
|
|
|
+
|
|
hdrs bazel.LabelListAttribute
|
|
hdrs bazel.LabelListAttribute
|
|
|
|
|
|
rtti bazel.BoolAttribute
|
|
rtti bazel.BoolAttribute
|
|
@@ -482,6 +487,7 @@ func (ca *compilerAttributes) finalize(ctx android.BazelConversionPathContext, i
|
|
ca.asmSrcs = partitionedSrcs[asmSrcPartition]
|
|
ca.asmSrcs = partitionedSrcs[asmSrcPartition]
|
|
ca.lSrcs = partitionedSrcs[lSrcPartition]
|
|
ca.lSrcs = partitionedSrcs[lSrcPartition]
|
|
ca.llSrcs = partitionedSrcs[llSrcPartition]
|
|
ca.llSrcs = partitionedSrcs[llSrcPartition]
|
|
|
|
+ ca.syspropSrcs = partitionedSrcs[syspropSrcPartition]
|
|
|
|
|
|
ca.absoluteIncludes.DeduplicateAxesFromBase()
|
|
ca.absoluteIncludes.DeduplicateAxesFromBase()
|
|
ca.localIncludes.DeduplicateAxesFromBase()
|
|
ca.localIncludes.DeduplicateAxesFromBase()
|
|
@@ -734,6 +740,10 @@ func bp2BuildParseBaseProps(ctx android.Bp2buildMutatorContext, module *Module)
|
|
(&compilerAttrs).srcs.Add(&convertedLSrcs.srcName)
|
|
(&compilerAttrs).srcs.Add(&convertedLSrcs.srcName)
|
|
(&compilerAttrs).cSrcs.Add(&convertedLSrcs.cSrcName)
|
|
(&compilerAttrs).cSrcs.Add(&convertedLSrcs.cSrcName)
|
|
|
|
|
|
|
|
+ if !compilerAttrs.syspropSrcs.IsEmpty() {
|
|
|
|
+ (&linkerAttrs).wholeArchiveDeps.Add(bp2buildCcSysprop(ctx, module.Name(), module.Properties.Min_sdk_version, compilerAttrs.syspropSrcs))
|
|
|
|
+ }
|
|
|
|
+
|
|
features := compilerAttrs.features.Clone().Append(linkerAttrs.features)
|
|
features := compilerAttrs.features.Clone().Append(linkerAttrs.features)
|
|
features.DeduplicateAxesFromBase()
|
|
features.DeduplicateAxesFromBase()
|
|
|
|
|
|
@@ -1208,10 +1218,14 @@ func bp2BuildParseExportedIncludes(ctx android.BazelConversionPathContext, modul
|
|
return exported
|
|
return exported
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func BazelLabelNameForStaticModule(baseLabel string) string {
|
|
|
|
+ return baseLabel + "_bp2build_cc_library_static"
|
|
|
|
+}
|
|
|
|
+
|
|
func bazelLabelForStaticModule(ctx android.BazelConversionPathContext, m blueprint.Module) string {
|
|
func bazelLabelForStaticModule(ctx android.BazelConversionPathContext, m blueprint.Module) string {
|
|
label := android.BazelModuleLabel(ctx, m)
|
|
label := android.BazelModuleLabel(ctx, m)
|
|
if ccModule, ok := m.(*Module); ok && ccModule.typ() == fullLibrary && !android.GetBp2BuildAllowList().GenerateCcLibraryStaticOnly(m.Name()) {
|
|
if ccModule, ok := m.(*Module); ok && ccModule.typ() == fullLibrary && !android.GetBp2BuildAllowList().GenerateCcLibraryStaticOnly(m.Name()) {
|
|
- label += "_bp2build_cc_library_static"
|
|
|
|
|
|
+ return BazelLabelNameForStaticModule(label)
|
|
}
|
|
}
|
|
return label
|
|
return label
|
|
}
|
|
}
|