Make include_dirs and local_include_dirs configurable
Requested by a user. Fixes: 377540448 Test: m nothing --no-skip-soong-tests Change-Id: I59e49c68e1d47ee0914677714cedcddf624903e6
This commit is contained in:
@@ -78,11 +78,11 @@ type BaseCompilerProperties struct {
|
|||||||
// If possible, don't use this. If adding paths from the current directory use
|
// 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
|
// local_include_dirs, if adding paths from other modules use export_include_dirs in
|
||||||
// that module.
|
// 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
|
// list of directories relative to the Blueprints file that will
|
||||||
// be added to the include path using -I
|
// 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
|
// Add the directory containing the Android.bp file to the list of include
|
||||||
// directories. Defaults to true.
|
// directories. Defaults to true.
|
||||||
@@ -407,13 +407,13 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Include dir cflags
|
// 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 {
|
if len(localIncludeDirs) > 0 {
|
||||||
f := includeDirsToFlags(localIncludeDirs)
|
f := includeDirsToFlags(localIncludeDirs)
|
||||||
flags.Local.CommonFlags = append(flags.Local.CommonFlags, f)
|
flags.Local.CommonFlags = append(flags.Local.CommonFlags, f)
|
||||||
flags.Local.YasmFlags = append(flags.Local.YasmFlags, 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 {
|
if len(rootIncludeDirs) > 0 {
|
||||||
f := includeDirsToFlags(rootIncludeDirs)
|
f := includeDirsToFlags(rootIncludeDirs)
|
||||||
flags.Local.CommonFlags = append(flags.Local.CommonFlags, f)
|
flags.Local.CommonFlags = append(flags.Local.CommonFlags, f)
|
||||||
@@ -804,7 +804,7 @@ func compileObjs(ctx ModuleContext, flags builderFlags, subdir string,
|
|||||||
type RustBindgenClangProperties struct {
|
type RustBindgenClangProperties struct {
|
||||||
// list of directories relative to the Blueprints file that will
|
// list of directories relative to the Blueprints file that will
|
||||||
// be added to the include path using -I
|
// 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 static libraries that provide headers for this binding.
|
// list of static libraries that provide headers for this binding.
|
||||||
Static_libs proptools.Configurable[[]string] `android:"arch_variant,variant_prepend"`
|
Static_libs proptools.Configurable[[]string] `android:"arch_variant,variant_prepend"`
|
||||||
|
@@ -250,7 +250,7 @@ func (b *bindgenDecorator) GenerateSource(ctx ModuleContext, deps PathDeps) andr
|
|||||||
|
|
||||||
// Module defined clang flags and include paths
|
// Module defined clang flags and include paths
|
||||||
cflags = append(cflags, esc(cflagsProp)...)
|
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())
|
cflags = append(cflags, "-I"+android.PathForModuleSrc(ctx, include).String())
|
||||||
implicits = append(implicits, android.PathForModuleSrc(ctx, include))
|
implicits = append(implicits, android.PathForModuleSrc(ctx, include))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user