Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cc/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ type BaseCompilerProperties struct {
// If possible, don't use this. If adding paths from the current directory use
// local_include_dirs, if adding paths from other modules use export_include_dirs in
// that module.
Include_dirs []string `android:"arch_variant,variant_prepend"`
Include_dirs proptools.Configurable[[]string] `android:"arch_variant,variant_prepend"`

// list of directories relative to the Blueprints file that will
// be added to the include path using -I
Local_include_dirs []string `android:"arch_variant,variant_prepend"`
Local_include_dirs proptools.Configurable[[]string] `android:"arch_variant,variant_prepend"`

// Add the directory containing the Android.bp file to the list of include
// directories. Defaults to true.
Expand Down Expand Up @@ -406,13 +406,13 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
}

// Include dir cflags
localIncludeDirs := android.PathsForModuleSrc(ctx, compiler.Properties.Local_include_dirs)
localIncludeDirs := android.PathsForModuleSrc(ctx, compiler.Properties.Local_include_dirs.GetOrDefault(ctx, nil))
if len(localIncludeDirs) > 0 {
f := includeDirsToFlags(localIncludeDirs)
flags.Local.CommonFlags = append(flags.Local.CommonFlags, f)
flags.Local.YasmFlags = append(flags.Local.YasmFlags, f)
}
rootIncludeDirs := android.PathsForSource(ctx, compiler.Properties.Include_dirs)
rootIncludeDirs := android.PathsForSource(ctx, compiler.Properties.Include_dirs.GetOrDefault(ctx, nil))
if len(rootIncludeDirs) > 0 {
f := includeDirsToFlags(rootIncludeDirs)
flags.Local.CommonFlags = append(flags.Local.CommonFlags, f)
Expand Down Expand Up @@ -805,7 +805,7 @@ func compileObjs(ctx ModuleContext, flags builderFlags, subdir string,
type RustBindgenClangProperties struct {
// list of directories relative to the Blueprints file that will
// be added to the include path using -I
Local_include_dirs []string `android:"arch_variant,variant_prepend"`
Local_include_dirs proptools.Configurable[[]string] `android:"arch_variant,variant_prepend"`

// list of Rust static libraries.
Static_rlibs []string `android:"arch_variant,variant_prepend"`
Expand Down
2 changes: 1 addition & 1 deletion rust/bindgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (b *bindgenDecorator) GenerateSource(ctx ModuleContext, deps PathDeps) andr

// Module defined clang flags and include paths
cflags = append(cflags, esc(cflagsProp)...)
for _, include := range b.ClangProperties.Local_include_dirs {
for _, include := range b.ClangProperties.Local_include_dirs.GetOrDefault(ctx, nil) {
cflags = append(cflags, "-I"+android.PathForModuleSrc(ctx, include).String())
implicits = append(implicits, android.PathForModuleSrc(ctx, include))
}
Expand Down