Merge "Make __ANDROID_APEX_<NAME>__ macro optional" am: 6efd3598c5 am: 2db5d65577

Change-Id: Ie3ef4fffa6f1b751e8e05daec16a21ed6b771ca4
This commit is contained in:
Automerger Merge Worker
2020-03-04 00:01:07 +00:00
2 changed files with 40 additions and 12 deletions

View File

@@ -176,6 +176,9 @@ type BaseCompilerProperties struct {
// Build and link with OpenMP
Openmp *bool `android:"arch_variant"`
// Adds __ANDROID_APEX_<APEX_MODULE_NAME>__ macro defined for apex variants in addition to __ANDROID_APEX__
Use_apex_name_macro *bool
}
func NewBaseCompiler() *baseCompiler {
@@ -321,9 +324,10 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
}
if ctx.apexName() != "" {
flags.Global.CommonFlags = append(flags.Global.CommonFlags,
"-D__ANDROID_APEX__",
"-D__ANDROID_APEX_"+makeDefineString(ctx.apexName())+"__")
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX__")
if Bool(compiler.Properties.Use_apex_name_macro) {
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX_"+makeDefineString(ctx.apexName())+"__")
}
}
instructionSet := String(compiler.Properties.Instruction_set)