summaryrefslogtreecommitdiff
path: root/rust/library.go
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2024-03-21 13:43:14 -0400
committer Ivan Lozano <ivanlozano@google.com> 2024-03-21 17:53:19 +0000
commitf033ca61a2cc5808692cc791c5029c24ce1e86ba (patch)
tree3c0df3a20b303f5857b219f8121f30c361932352 /rust/library.go
parent181a27986c8a18efe95ffca76facfd0d9034c697 (diff)
rust: Add export_include_dirs property to rust_ffi
The cc property include_dirs is neverallowed in certain paths since it has been deprecated. The property in rust_ffi modules with the same name functionally works the same way as the CC property export_include_dirs. To reduce confusion, and avoid triggering the neverallow rule, deprecate include_dirs and create an export_include_dirs property which does the same thing. This brings rust module properties into better alignment with cc module property as well, reducing confusion. Bug: 330736943 Test: New Soong test Change-Id: Ib2020a22e6747ac690c46dbff84e38744f93ed15
Diffstat (limited to 'rust/library.go')
-rw-r--r--rust/library.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/rust/library.go b/rust/library.go
index 7f004fc20..3560d73ed 100644
--- a/rust/library.go
+++ b/rust/library.go
@@ -54,9 +54,13 @@ type LibraryCompilerProperties struct {
Shared VariantLibraryProperties `android:"arch_variant"`
Static VariantLibraryProperties `android:"arch_variant"`
- // path to include directories to pass to cc_* modules, only relevant for static/shared variants.
+ // TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
+ // path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
Include_dirs []string `android:"path,arch_variant"`
+ // path to include directories to export to cc_* modules, only relevant for static/shared variants.
+ Export_include_dirs []string `android:"path,arch_variant"`
+
// Whether this library is part of the Rust toolchain sysroot.
Sysroot *bool
}
@@ -465,6 +469,7 @@ func (library *libraryDecorator) compilerFlags(ctx ModuleContext, flags Flags) F
flags.RustFlags = append(flags.RustFlags, "-C metadata="+ctx.ModuleName())
if library.shared() || library.static() {
library.includeDirs = append(library.includeDirs, android.PathsForModuleSrc(ctx, library.Properties.Include_dirs)...)
+ library.includeDirs = append(library.includeDirs, android.PathsForModuleSrc(ctx, library.Properties.Export_include_dirs)...)
}
if library.shared() {
if ctx.Darwin() {