Merge "Add support for include_files"
This commit is contained in:
commit
2e238cfa31
2 changed files with 21 additions and 0 deletions
17
cc/cc.go
17
cc/cc.go
|
@ -218,10 +218,20 @@ type CCBaseProperties struct {
|
|||
// that module.
|
||||
Include_dirs []string `android:"arch_variant"`
|
||||
|
||||
// list of files relative to the root of the source tree that will be included
|
||||
// using -include.
|
||||
// If possible, don't use this.
|
||||
Include_files []string `android:"arch_variant"`
|
||||
|
||||
// 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"`
|
||||
|
||||
// list of files relative to the Blueprints file that will be included
|
||||
// using -include.
|
||||
// If possible, don't use this.
|
||||
Local_include_files []string `android:"arch_variant"`
|
||||
|
||||
// list of directories relative to the Blueprints file that will
|
||||
// be added to the include path using -I for any module that links against this module
|
||||
Export_include_dirs []string `android:"arch_variant"`
|
||||
|
@ -447,6 +457,13 @@ func (c *CCBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha
|
|||
includeDirsToFlags(rootIncludeDirs),
|
||||
includeDirsToFlags(localIncludeDirs))
|
||||
|
||||
rootIncludeFiles := pathtools.PrefixPaths(c.Properties.Include_files, ctx.AConfig().SrcDir())
|
||||
localIncludeFiles := pathtools.PrefixPaths(c.Properties.Local_include_files, common.ModuleSrcDir(ctx))
|
||||
|
||||
flags.GlobalFlags = append(flags.GlobalFlags,
|
||||
includeFilesToFlags(rootIncludeFiles),
|
||||
includeFilesToFlags(localIncludeFiles))
|
||||
|
||||
if !c.Properties.No_default_compiler_flags {
|
||||
if c.Properties.Sdk_version == "" || ctx.Host() {
|
||||
flags.GlobalFlags = append(flags.GlobalFlags,
|
||||
|
|
|
@ -28,6 +28,10 @@ func includeDirsToFlags(dirs []string) string {
|
|||
return common.JoinWithPrefix(dirs, "-I")
|
||||
}
|
||||
|
||||
func includeFilesToFlags(dirs []string) string {
|
||||
return common.JoinWithPrefix(dirs, "-include ")
|
||||
}
|
||||
|
||||
func ldDirsToFlags(dirs []string) string {
|
||||
return common.JoinWithPrefix(dirs, "-L")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue