diff options
author | 2023-02-24 19:19:22 +0000 | |
---|---|---|
committer | 2023-02-24 19:21:08 +0000 | |
commit | 65a54a8e3d9dcf40da22a72ab5af054cfa23b236 (patch) | |
tree | aa25ecc0fd74477eb71c5354ad8c20fb1d044bb8 /rust/compiler.go | |
parent | 5fba88bbd6fa8edc97dada1910db3d1eb35005a8 (diff) |
rust: Set android_vendor and android_product cfg
Add `android_vendor` and `android_product` cfgs, similar to
__ANDROID_VENDOR__ and __ANDROID_PRODUCT__ defines for C++
Bug: 270718001
Test: m nothing with added test
Change-Id: Ibeabe2983d1454e5a2ec0bb2f43e793b8f32a5c2
Diffstat (limited to 'rust/compiler.go')
-rw-r--r-- | rust/compiler.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rust/compiler.go b/rust/compiler.go index 31acd49cb..06ae12f79 100644 --- a/rust/compiler.go +++ b/rust/compiler.go @@ -269,6 +269,11 @@ func (compiler *baseCompiler) featureFlags(ctx ModuleContext, flags Flags) Flags func (compiler *baseCompiler) cfgFlags(ctx ModuleContext, flags Flags) Flags { if ctx.RustModule().UseVndk() { compiler.Properties.Cfgs = append(compiler.Properties.Cfgs, "android_vndk") + if ctx.RustModule().InVendor() { + compiler.Properties.Cfgs = append(compiler.Properties.Cfgs, "android_vendor") + } else if ctx.RustModule().InProduct() { + compiler.Properties.Cfgs = append(compiler.Properties.Cfgs, "android_product") + } } flags.RustFlags = append(flags.RustFlags, compiler.cfgsToFlags()...) |