rust: add aconfig_flag support

Bug: b/308625757
Test: manual
Change-Id: Ifd98cd0ad4e2525b08f5766e9332991c049162ea
This commit is contained in:
LaMont Jones
2023-12-07 21:56:59 +00:00
parent d788b3e6cb
commit 0c97185450
3 changed files with 9 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ bootstrap_go_package {
pkgPath: "android/soong/rust", pkgPath: "android/soong/rust",
deps: [ deps: [
"soong", "soong",
"soong-aconfig",
"soong-android", "soong-android",
"soong-bloaty", "soong-bloaty",
"soong-cc", "soong-cc",

View File

@@ -66,7 +66,8 @@ func (mod *Module) AndroidMkEntries() []android.AndroidMkEntries {
if mod.UseVndk() { if mod.UseVndk() {
entries.SetBool("LOCAL_USE_VNDK", true) entries.SetBool("LOCAL_USE_VNDK", true)
} }
// TODO(b/311155208): The container here should be system.
entries.SetPaths("LOCAL_ACONFIG_FILES", mod.mergedAconfigFiles[""])
}, },
}, },
} }

View File

@@ -26,6 +26,7 @@ import (
"github.com/google/blueprint" "github.com/google/blueprint"
"github.com/google/blueprint/proptools" "github.com/google/blueprint/proptools"
"android/soong/aconfig"
"android/soong/android" "android/soong/android"
"android/soong/cc" "android/soong/cc"
cc_config "android/soong/cc/config" cc_config "android/soong/cc/config"
@@ -176,6 +177,9 @@ type Module struct {
transitiveAndroidMkSharedLibs *android.DepSet[string] transitiveAndroidMkSharedLibs *android.DepSet[string]
android.BazelModuleBase android.BazelModuleBase
// Aconfig files for all transitive deps. Also exposed via TransitiveDeclarationsInfo
mergedAconfigFiles map[string]android.Paths
} }
func (mod *Module) Header() bool { func (mod *Module) Header() bool {
@@ -1006,6 +1010,8 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
if mod.testModule { if mod.testModule {
ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{}) ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{})
} }
aconfig.CollectDependencyAconfigFiles(ctx, &mod.mergedAconfigFiles)
} }
func (mod *Module) deps(ctx DepsContext) Deps { func (mod *Module) deps(ctx DepsContext) Deps {