From e2ec01ccf8d82a2f8c1b41da959d3b5d3af95f1e Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Wed, 19 Mar 2025 15:20:37 +0900 Subject: Make the fdo_profile configurable Test: m nothing Bug: 404481956 Bug: 404706675 Change-Id: I424a0b26bf9b348e9b9c48027be78f5d445f1764 --- cc/fdo_profile.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cc') diff --git a/cc/fdo_profile.go b/cc/fdo_profile.go index 1a3395773..c79ea1018 100644 --- a/cc/fdo_profile.go +++ b/cc/fdo_profile.go @@ -17,6 +17,8 @@ package cc import ( "android/soong/android" "github.com/google/blueprint" + + "github.com/google/blueprint/proptools" ) func init() { @@ -34,7 +36,7 @@ type fdoProfile struct { } type fdoProfileProperties struct { - Profile *string `android:"arch_variant"` + Profile proptools.Configurable[string] `android:"arch_variant,replace_instead_of_append"` } // FdoProfileInfo is provided by FdoProfileProvider @@ -47,8 +49,9 @@ var FdoProfileProvider = blueprint.NewProvider[FdoProfileInfo]() // GenerateAndroidBuildActions of fdo_profile does not have any build actions func (fp *fdoProfile) GenerateAndroidBuildActions(ctx android.ModuleContext) { - if fp.properties.Profile != nil { - path := android.PathForModuleSrc(ctx, *fp.properties.Profile) + profile := fp.properties.Profile.GetOrDefault(ctx, "") + if profile != "" { + path := android.PathForModuleSrc(ctx, profile) android.SetProvider(ctx, FdoProfileProvider, FdoProfileInfo{ Path: path, }) -- cgit v1.2.3-59-g8ed1b