Add export_*_lib_headers to static and shared properties
Allow specifying export_static_lib_headers and export_shared_lib_headers in the static or shared properties of cc_library modules. Use a named struct for the properties to avoid having to create a runtime struct type since none of the properties are filtered. This avoids running into the name length limit in runtime.StructOf. Fixes: 122882789 Test: m checkbuild Change-Id: Ib0e9933e93981ba44668a19ed748bd12a4dd4257
This commit is contained in:
@@ -29,27 +29,23 @@ import (
|
|||||||
"android/soong/genrule"
|
"android/soong/genrule"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type StaticSharedLibraryProperties struct {
|
||||||
|
Srcs []string `android:"arch_variant"`
|
||||||
|
Cflags []string `android:"arch_variant"`
|
||||||
|
|
||||||
|
Enabled *bool `android:"arch_variant"`
|
||||||
|
Whole_static_libs []string `android:"arch_variant"`
|
||||||
|
Static_libs []string `android:"arch_variant"`
|
||||||
|
Shared_libs []string `android:"arch_variant"`
|
||||||
|
System_shared_libs []string `android:"arch_variant"`
|
||||||
|
|
||||||
|
Export_shared_lib_headers []string `android:"arch_variant"`
|
||||||
|
Export_static_lib_headers []string `android:"arch_variant"`
|
||||||
|
}
|
||||||
|
|
||||||
type LibraryProperties struct {
|
type LibraryProperties struct {
|
||||||
Static struct {
|
Static StaticSharedLibraryProperties `android:"arch_variant"`
|
||||||
Srcs []string `android:"arch_variant"`
|
Shared StaticSharedLibraryProperties `android:"arch_variant"`
|
||||||
Cflags []string `android:"arch_variant"`
|
|
||||||
|
|
||||||
Enabled *bool `android:"arch_variant"`
|
|
||||||
Whole_static_libs []string `android:"arch_variant"`
|
|
||||||
Static_libs []string `android:"arch_variant"`
|
|
||||||
Shared_libs []string `android:"arch_variant"`
|
|
||||||
System_shared_libs []string `android:"arch_variant"`
|
|
||||||
} `android:"arch_variant"`
|
|
||||||
Shared struct {
|
|
||||||
Srcs []string `android:"arch_variant"`
|
|
||||||
Cflags []string `android:"arch_variant"`
|
|
||||||
|
|
||||||
Enabled *bool `android:"arch_variant"`
|
|
||||||
Whole_static_libs []string `android:"arch_variant"`
|
|
||||||
Static_libs []string `android:"arch_variant"`
|
|
||||||
Shared_libs []string `android:"arch_variant"`
|
|
||||||
System_shared_libs []string `android:"arch_variant"`
|
|
||||||
} `android:"arch_variant"`
|
|
||||||
|
|
||||||
// local file name to pass to the linker as -unexported_symbols_list
|
// local file name to pass to the linker as -unexported_symbols_list
|
||||||
Unexported_symbols_list *string `android:"arch_variant"`
|
Unexported_symbols_list *string `android:"arch_variant"`
|
||||||
@@ -539,6 +535,9 @@ func (library *libraryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
|
|||||||
library.Properties.Static.Whole_static_libs...)
|
library.Properties.Static.Whole_static_libs...)
|
||||||
deps.StaticLibs = append(deps.StaticLibs, library.Properties.Static.Static_libs...)
|
deps.StaticLibs = append(deps.StaticLibs, library.Properties.Static.Static_libs...)
|
||||||
deps.SharedLibs = append(deps.SharedLibs, library.Properties.Static.Shared_libs...)
|
deps.SharedLibs = append(deps.SharedLibs, library.Properties.Static.Shared_libs...)
|
||||||
|
|
||||||
|
deps.ReexportSharedLibHeaders = append(deps.ReexportSharedLibHeaders, library.Properties.Static.Export_shared_lib_headers...)
|
||||||
|
deps.ReexportStaticLibHeaders = append(deps.ReexportStaticLibHeaders, library.Properties.Static.Export_static_lib_headers...)
|
||||||
} else if library.shared() {
|
} else if library.shared() {
|
||||||
if ctx.toolchain().Bionic() && !Bool(library.baseLinker.Properties.Nocrt) {
|
if ctx.toolchain().Bionic() && !Bool(library.baseLinker.Properties.Nocrt) {
|
||||||
if !ctx.useSdk() {
|
if !ctx.useSdk() {
|
||||||
@@ -560,6 +559,9 @@ func (library *libraryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
|
|||||||
deps.WholeStaticLibs = append(deps.WholeStaticLibs, library.Properties.Shared.Whole_static_libs...)
|
deps.WholeStaticLibs = append(deps.WholeStaticLibs, library.Properties.Shared.Whole_static_libs...)
|
||||||
deps.StaticLibs = append(deps.StaticLibs, library.Properties.Shared.Static_libs...)
|
deps.StaticLibs = append(deps.StaticLibs, library.Properties.Shared.Static_libs...)
|
||||||
deps.SharedLibs = append(deps.SharedLibs, library.Properties.Shared.Shared_libs...)
|
deps.SharedLibs = append(deps.SharedLibs, library.Properties.Shared.Shared_libs...)
|
||||||
|
|
||||||
|
deps.ReexportSharedLibHeaders = append(deps.ReexportSharedLibHeaders, library.Properties.Shared.Export_shared_lib_headers...)
|
||||||
|
deps.ReexportStaticLibHeaders = append(deps.ReexportStaticLibHeaders, library.Properties.Shared.Export_static_lib_headers...)
|
||||||
}
|
}
|
||||||
if ctx.useVndk() {
|
if ctx.useVndk() {
|
||||||
deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, library.baseLinker.Properties.Target.Vendor.Exclude_static_libs)
|
deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, library.baseLinker.Properties.Target.Vendor.Exclude_static_libs)
|
||||||
|
Reference in New Issue
Block a user