Add support for variant_prepend properties in bp2build for cc library
Some properties in soong are marked "variant_prepend", which means in bp2build output, variant properties(select ...) should come before general properties. Prepend property is added in StringListAttribute stuct so that bp2build can handlle variant_prepend properly, if Prepend is properly set in different module logics. This change also coordinates cc library with Prepend. Coordination with other module types will be in separate CLs. Bug: 261644490 Test: TestCcLibraryHeadersSimple, TestCcLibraryHeadersArchAndTargetExportSystemIncludes and TH Change-Id: I3b61c491c54bbe91ba9aa2af9b4c84193c91ae7f
This commit is contained in:
@@ -1257,6 +1257,13 @@ func bp2BuildParseExportedIncludes(ctx android.BazelConversionPathContext, modul
|
||||
} else {
|
||||
exported = BazelIncludes{}
|
||||
}
|
||||
|
||||
// cc library Export_include_dirs and Export_system_include_dirs are marked
|
||||
// "variant_prepend" in struct tag, set their prepend property to true to make
|
||||
// sure bp2build generates correct result.
|
||||
exported.Includes.Prepend = true
|
||||
exported.SystemIncludes.Prepend = true
|
||||
|
||||
bp2BuildPropParseHelper(ctx, module, &FlagExporterProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
|
||||
if flagExporterProperties, ok := props.(*FlagExporterProperties); ok {
|
||||
if len(flagExporterProperties.Export_include_dirs) > 0 {
|
||||
|
Reference in New Issue
Block a user