Loading cc/compiler.go +13 −2 Original line number Diff line number Diff line Loading @@ -189,8 +189,14 @@ type BaseCompilerProperties struct { // Build and link with OpenMP Openmp *bool `android:"arch_variant"` // Deprecated. // Adds __ANDROID_APEX_<APEX_MODULE_NAME>__ macro defined for apex variants in addition to __ANDROID_APEX__ Use_apex_name_macro *bool // Adds two macros for apex variants in addition to __ANDROID_APEX__ // * __ANDROID_APEX_COM_ANDROID_FOO__ // * __ANDROID_APEX_NAME__="com.android.foo" UseApexNameMacro bool `blueprint:"mutated"` } func NewBaseCompiler() *baseCompiler { Loading Loading @@ -254,6 +260,10 @@ func (compiler *baseCompiler) compilerDeps(ctx DepsContext, deps Deps) Deps { return deps } func (compiler *baseCompiler) useApexNameMacro() bool { return Bool(compiler.Properties.Use_apex_name_macro) || compiler.Properties.UseApexNameMacro } // Return true if the module is in the WarningAllowedProjects. func warningsAreAllowed(subdir string) bool { subdir += "/" Loading Loading @@ -337,8 +347,9 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps if ctx.apexVariationName() != "" { flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX__") if Bool(compiler.Properties.Use_apex_name_macro) { if compiler.useApexNameMacro() { flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX_"+makeDefineString(ctx.apexVariationName())+"__") flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX_NAME__='\""+ctx.apexVariationName()+"\"'") } if ctx.Device() { flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_SDK_VERSION__="+strconv.Itoa(ctx.apexSdkVersion())) Loading Loading @@ -557,7 +568,7 @@ func (compiler *baseCompiler) hasSrcExt(ext string) bool { } func (compiler *baseCompiler) uniqueApexVariations() bool { return Bool(compiler.Properties.Use_apex_name_macro) return compiler.useApexNameMacro() } // makeDefineString transforms a name of an APEX module into a value to be used as value for C define Loading Loading
cc/compiler.go +13 −2 Original line number Diff line number Diff line Loading @@ -189,8 +189,14 @@ type BaseCompilerProperties struct { // Build and link with OpenMP Openmp *bool `android:"arch_variant"` // Deprecated. // Adds __ANDROID_APEX_<APEX_MODULE_NAME>__ macro defined for apex variants in addition to __ANDROID_APEX__ Use_apex_name_macro *bool // Adds two macros for apex variants in addition to __ANDROID_APEX__ // * __ANDROID_APEX_COM_ANDROID_FOO__ // * __ANDROID_APEX_NAME__="com.android.foo" UseApexNameMacro bool `blueprint:"mutated"` } func NewBaseCompiler() *baseCompiler { Loading Loading @@ -254,6 +260,10 @@ func (compiler *baseCompiler) compilerDeps(ctx DepsContext, deps Deps) Deps { return deps } func (compiler *baseCompiler) useApexNameMacro() bool { return Bool(compiler.Properties.Use_apex_name_macro) || compiler.Properties.UseApexNameMacro } // Return true if the module is in the WarningAllowedProjects. func warningsAreAllowed(subdir string) bool { subdir += "/" Loading Loading @@ -337,8 +347,9 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps if ctx.apexVariationName() != "" { flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX__") if Bool(compiler.Properties.Use_apex_name_macro) { if compiler.useApexNameMacro() { flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX_"+makeDefineString(ctx.apexVariationName())+"__") flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_APEX_NAME__='\""+ctx.apexVariationName()+"\"'") } if ctx.Device() { flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_SDK_VERSION__="+strconv.Itoa(ctx.apexSdkVersion())) Loading Loading @@ -557,7 +568,7 @@ func (compiler *baseCompiler) hasSrcExt(ext string) bool { } func (compiler *baseCompiler) uniqueApexVariations() bool { return Bool(compiler.Properties.Use_apex_name_macro) return compiler.useApexNameMacro() } // makeDefineString transforms a name of an APEX module into a value to be used as value for C define Loading