diff options
author | Ivan Lozano <ivanlozano@google.com> | 2021-02-12 09:55:06 -0500 |
---|---|---|
committer | Ivan Lozano <ivanlozano@google.com> | 2021-02-12 12:17:50 -0500 |
commit | f76cdf7c20d87796324d935e5d5f23605cf2af4f (patch) | |
tree | ee568847f072e6ba964a544c0cf8663f218bf082 /rust/compiler.go | |
parent | 81314ff2e6a906a0d2400d0fd900fe77007fcf3b (diff) |
rust: Emit android vndk cfg flag.
Pass an "android_vndk" cfg flag that indicates this code
targets the vndk. This can be useful in instances where code
might need to behave differently.
This also includes a fix to make sure our vendor Soong tests
are correctly configured.
Bug: 179907868
Test: Soong tests pass.
Test: Example module emits new cfg flags.
Change-Id: I01cdf91f6f9d42cd8a759266d5170479664bf4bc
Diffstat (limited to 'rust/compiler.go')
-rw-r--r-- | rust/compiler.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rust/compiler.go b/rust/compiler.go index 586063e91..e4120d035 100644 --- a/rust/compiler.go +++ b/rust/compiler.go @@ -232,6 +232,10 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag flags.LinkFlags = append(flags.LinkFlags, "-Wl,-rpath,"+rpathPrefix+"../"+rpath) } + if ctx.RustModule().UseVndk() { + flags.RustFlags = append(flags.RustFlags, "--cfg 'android_vndk'") + } + return flags } |