Drive instrumentation with build flag for C/C++ am: 10fff94e2e

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3065602

Change-Id: Ie46b65da536109501103fd6cf85c3ab475a2de12
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Ted Bauer
2024-04-29 21:44:29 +00:00
committed by Automerger Merge Worker
3 changed files with 10 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ import (
"github.com/google/blueprint/proptools"
"fmt"
"strconv"
"strings"
)
@@ -152,6 +153,7 @@ func (this *CcAconfigLibraryCallbacks) GeneratorBuildActions(ctx cc.ModuleContex
Args: map[string]string{
"gendir": this.generatedDir.String(),
"mode": mode,
"debug": strconv.FormatBool(ctx.Config().ReleaseReadFromNewStorageCc()),
},
})

View File

@@ -49,11 +49,12 @@ var (
` && ${aconfig} create-cpp-lib` +
` --mode ${mode}` +
` --cache ${in}` +
` --out ${gendir}`,
` --out ${gendir}` +
` --allow-instrumentation ${debug}`,
CommandDeps: []string{
"$aconfig",
},
}, "gendir", "mode")
}, "gendir", "mode", "debug")
// For rust_aconfig_library: Generate Rust library
rustRule = pctx.AndroidStaticRule("rust_aconfig_library",

View File

@@ -229,6 +229,11 @@ func (c Config) ReleaseNdkAbiMonitored() bool {
return c.config.productVariables.GetBuildFlagBool("RELEASE_NDK_ABI_MONITORED")
}
// Enable read flag from new storage, for C/C++
func (c Config) ReleaseReadFromNewStorageCc() bool {
return c.config.productVariables.GetBuildFlagBool("RELEASE_READ_FROM_NEW_STORAGE_CC")
}
func (c Config) ReleaseHiddenApiExportableStubs() bool {
return c.config.productVariables.GetBuildFlagBool("RELEASE_HIDDEN_API_EXPORTABLE_STUBS") ||
Bool(c.config.productVariables.HiddenapiExportableStubs)