Support tailoring clang --target flag based on min sdk version.

Bug: 215748260
Test: Tested using aquery to verify the --target flag; add added unit

Change-Id: Ifb13509db7d1e110316aa44d55ec9cccaa4b83d1
This commit is contained in:
Yu Liu
2022-03-01 15:44:08 -08:00
parent 2d6e6a1338
commit fc603167f4
14 changed files with 78 additions and 3 deletions

View File

@@ -316,6 +316,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),
sdkAttributes: bp2BuildParseSdkAttributes(m),
}
sharedCommonAttrs := staticOrSharedAttributes{
@@ -331,6 +332,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),
sdkAttributes: bp2BuildParseSdkAttributes(m),
}
staticTargetAttrs := &bazelCcLibraryStaticAttributes{
@@ -2481,6 +2483,7 @@ func sharedOrStaticLibraryBp2Build(ctx android.TopDownMutatorContext, module *Mo
Whole_archive_deps: linkerAttrs.wholeArchiveDeps,
Implementation_whole_archive_deps: linkerAttrs.implementationWholeArchiveDeps,
System_dynamic_deps: linkerAttrs.systemDynamicDeps,
sdkAttributes: bp2BuildParseSdkAttributes(module),
}
var attrs interface{}