Add support for include_files
Support include_files and local_include_files to pass -include arguments to gcc. Change-Id: Ie3f03218fcbc9732741da91671b20e240f3de3a6
This commit is contained in:
parent
485e572aeb
commit
39d97f2a56
17
cc/cc.go
17
cc/cc.go
|
@ -218,10 +218,20 @@ type CCBaseProperties struct {
|
||||||
// that module.
|
// that module.
|
||||||
Include_dirs []string `android:"arch_variant"`
|
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
|
// 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"`
|
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
|
// 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
|
// be added to the include path using -I for any module that links against this module
|
||||||
Export_include_dirs []string `android:"arch_variant"`
|
Export_include_dirs []string `android:"arch_variant"`
|
||||||
|
@ -447,6 +457,13 @@ func (c *CCBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha
|
||||||
includeDirsToFlags(rootIncludeDirs),
|
includeDirsToFlags(rootIncludeDirs),
|
||||||
includeDirsToFlags(localIncludeDirs))
|
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.No_default_compiler_flags {
|
||||||
if c.Properties.Sdk_version == "" || ctx.Host() {
|
if c.Properties.Sdk_version == "" || ctx.Host() {
|
||||||
flags.GlobalFlags = append(flags.GlobalFlags,
|
flags.GlobalFlags = append(flags.GlobalFlags,
|
||||||
|
|
|
@ -28,6 +28,10 @@ func includeDirsToFlags(dirs []string) string {
|
||||||
return common.JoinWithPrefix(dirs, "-I")
|
return common.JoinWithPrefix(dirs, "-I")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func includeFilesToFlags(dirs []string) string {
|
||||||
|
return common.JoinWithPrefix(dirs, "-include ")
|
||||||
|
}
|
||||||
|
|
||||||
func ldDirsToFlags(dirs []string) string {
|
func ldDirsToFlags(dirs []string) string {
|
||||||
return common.JoinWithPrefix(dirs, "-L")
|
return common.JoinWithPrefix(dirs, "-L")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue