cc: add exclude_generated_sources property
generated_sources needs exclude_* just like that srcs needs exclude_srcs to support variant-specific exclusion of source files. Bug: 159585065 Test: m Change-Id: I49e49b0b3a0115a01fc9cf6f9fe74b23e723a785
This commit is contained in:
parent
8fab5bcce3
commit
ac07f880d8
2 changed files with 19 additions and 0 deletions
6
cc/cc.go
6
cc/cc.go
|
@ -3009,6 +3009,9 @@ func squashVendorSrcs(m *Module) {
|
|||
|
||||
lib.baseCompiler.Properties.Exclude_srcs = append(lib.baseCompiler.Properties.Exclude_srcs,
|
||||
lib.baseCompiler.Properties.Target.Vendor.Exclude_srcs...)
|
||||
|
||||
lib.baseCompiler.Properties.Exclude_generated_sources = append(lib.baseCompiler.Properties.Exclude_generated_sources,
|
||||
lib.baseCompiler.Properties.Target.Vendor.Exclude_generated_sources...)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3019,6 +3022,9 @@ func squashRecoverySrcs(m *Module) {
|
|||
|
||||
lib.baseCompiler.Properties.Exclude_srcs = append(lib.baseCompiler.Properties.Exclude_srcs,
|
||||
lib.baseCompiler.Properties.Target.Recovery.Exclude_srcs...)
|
||||
|
||||
lib.baseCompiler.Properties.Exclude_generated_sources = append(lib.baseCompiler.Properties.Exclude_generated_sources,
|
||||
lib.baseCompiler.Properties.Target.Recovery.Exclude_generated_sources...)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -86,6 +86,10 @@ type BaseCompilerProperties struct {
|
|||
// genrule modules.
|
||||
Generated_sources []string `android:"arch_variant"`
|
||||
|
||||
// list of generated sources that should not be used to build the C/C++ module.
|
||||
// This is most useful in the arch/multilib variants to remove non-common files
|
||||
Exclude_generated_sources []string `android:"arch_variant"`
|
||||
|
||||
// list of generated headers to add to the include path. These are the names
|
||||
// of genrule modules.
|
||||
Generated_headers []string `android:"arch_variant"`
|
||||
|
@ -150,6 +154,10 @@ type BaseCompilerProperties struct {
|
|||
// List of additional cflags that should be used to build the vendor
|
||||
// variant of the C/C++ module.
|
||||
Cflags []string
|
||||
|
||||
// list of generated sources that should not be used to
|
||||
// build the vendor variant of the C/C++ module.
|
||||
Exclude_generated_sources []string
|
||||
}
|
||||
Recovery struct {
|
||||
// list of source files that should only be used in the
|
||||
|
@ -163,6 +171,10 @@ type BaseCompilerProperties struct {
|
|||
// List of additional cflags that should be used to build the recovery
|
||||
// variant of the C/C++ module.
|
||||
Cflags []string
|
||||
|
||||
// list of generated sources that should not be used to
|
||||
// build the recovery variant of the C/C++ module.
|
||||
Exclude_generated_sources []string
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,6 +239,7 @@ func (compiler *baseCompiler) compilerInit(ctx BaseModuleContext) {}
|
|||
|
||||
func (compiler *baseCompiler) compilerDeps(ctx DepsContext, deps Deps) Deps {
|
||||
deps.GeneratedSources = append(deps.GeneratedSources, compiler.Properties.Generated_sources...)
|
||||
deps.GeneratedSources = removeListFromList(deps.GeneratedSources, compiler.Properties.Exclude_generated_sources)
|
||||
deps.GeneratedHeaders = append(deps.GeneratedHeaders, compiler.Properties.Generated_headers...)
|
||||
|
||||
android.ProtoDeps(ctx, &compiler.Proto)
|
||||
|
|
Loading…
Reference in a new issue