Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__
__ANDROID_VNDK__ is defined for the modules that are able to use the VNDK libraries. As both product and vendor variants define __ANDROID_VNDK__, we don't know if a module is built for vendor or product on build time. __ANDROID_VENDOR__ and __ANDROID_PRODUCT__ macros can be used to specify the image-variant-dependent codes. Bug: 180646847 Test: m nothing Change-Id: Id6c3e1e3d47deaf3684c0c02964718658cf2fec5
This commit is contained in:
@@ -357,6 +357,11 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
|
||||
|
||||
if ctx.useVndk() {
|
||||
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_VNDK__")
|
||||
if ctx.inVendor() {
|
||||
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_VENDOR__")
|
||||
} else if ctx.inProduct() {
|
||||
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "-D__ANDROID_PRODUCT__")
|
||||
}
|
||||
}
|
||||
|
||||
if ctx.inRecovery() {
|
||||
|
Reference in New Issue
Block a user