Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d6c7dc2 authored by Cole Faust's avatar Cole Faust Committed by Alexander Koskovich
Browse files

Make the WholeStatic/Static/Shared libs properties configurable

So that you can use selects with them.

Bug: 342006386
Bug: 358377461
Test: m nothing --no-skip-soong-tests
Change-Id: I5a8350f670d51b7da411ad5c3cdbf5f2d6cdd63b
parent a3336a40
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -803,6 +803,7 @@ type SdkMemberProperties interface {

// SdkMemberContext provides access to information common to a specific member.
type SdkMemberContext interface {
	ConfigAndErrorContext

	// SdkModuleContext returns the module context of the sdk common os variant which is creating the
	// snapshot.
+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ func (p *nativeBinaryInfoProperties) PopulateFromVariant(ctx android.SdkMemberCo

	if ccModule.linker != nil {
		specifiedDeps := specifiedDeps{}
		specifiedDeps = ccModule.linker.linkerSpecifiedDeps(specifiedDeps)
		specifiedDeps = ccModule.linker.linkerSpecifiedDeps(ctx, ccModule, specifiedDeps)

		p.SharedLibs = specifiedDeps.sharedLibs
		p.SystemSharedLibs = specifiedDeps.systemSharedLibs
+1 −1
Original line number Diff line number Diff line
@@ -613,7 +613,7 @@ type linker interface {
	coverageOutputFilePath() android.OptionalPath

	// Get the deps that have been explicitly specified in the properties.
	linkerSpecifiedDeps(specifiedDeps specifiedDeps) specifiedDeps
	linkerSpecifiedDeps(ctx android.ConfigAndErrorContext, module *Module, specifiedDeps specifiedDeps) specifiedDeps

	moduleInfoJSON(ctx ModuleContext, moduleInfoJSON *android.ModuleInfoJSON)
}
+4 −4
Original line number Diff line number Diff line
@@ -2,10 +2,10 @@
<<$includeDirs := getIncludeDirs .Ctx .M>>
<<$cflags := getCflagsProperty .Ctx .M>>
<<$deps := mapLibraries .Ctx .M (concat5
(getLinkerProperties .M).Whole_static_libs
(getLinkerProperties .M).Static_libs
(getLinkerProperties .M).Shared_libs
(getLinkerProperties .M).Header_libs
(getWholeStaticLibsProperty .Ctx .M)
(getStaticLibsProperty .Ctx .M)
(getSharedLibsProperty .Ctx .M)
(getHeaderLibsProperty .Ctx .M)
(getExtraLibs .M)
) .Pprop.LibraryMapping>>
<<$moduleType := getModuleType .M>>
+18 −2
Original line number Diff line number Diff line
@@ -188,12 +188,28 @@ func parseTemplate(templateContents string) *template.Template {
			return m.compiler.baseCompilerProps()
		},
		"getCflagsProperty": func(ctx android.ModuleContext, m *Module) []string {
			cflags := m.compiler.baseCompilerProps().Cflags
			return cflags.GetOrDefault(ctx, nil)
			prop := m.compiler.baseCompilerProps().Cflags
			return prop.GetOrDefault(ctx, nil)
		},
		"getLinkerProperties": func(m *Module) BaseLinkerProperties {
			return m.linker.baseLinkerProps()
		},
		"getWholeStaticLibsProperty": func(ctx android.ModuleContext, m *Module) []string {
			prop := m.linker.baseLinkerProps().Whole_static_libs
			return prop.GetOrDefault(ctx, nil)
		},
		"getStaticLibsProperty": func(ctx android.ModuleContext, m *Module) []string {
			prop := m.linker.baseLinkerProps().Static_libs
			return prop.GetOrDefault(ctx, nil)
		},
		"getSharedLibsProperty": func(ctx android.ModuleContext, m *Module) []string {
			prop := m.linker.baseLinkerProps().Shared_libs
			return prop.GetOrDefault(ctx, nil)
		},
		"getHeaderLibsProperty": func(ctx android.ModuleContext, m *Module) []string {
			prop := m.linker.baseLinkerProps().Header_libs
			return prop.GetOrDefault(ctx, nil)
		},
		"getExtraLibs":   getExtraLibs,
		"getIncludeDirs": getIncludeDirs,
		"mapLibraries": func(ctx android.ModuleContext, m *Module, libs []string, mapping map[string]LibraryMappingProperty) []string {
Loading