soong: Add equivalent for LOCAL_EXPORT_CFLAGS
Change-Id: Ieb3e5739b50789bdbaf41a7d5adb04b08f7b9ea2
This commit is contained in:
committed by
SkyMinus
parent
d70492f14f
commit
4f1e88fab3
@@ -759,6 +759,13 @@ func cflags(ctx variableAssignmentContext) error {
|
||||
return includeVariableNow(bpVariable{"cflags", bpparser.ListType}, ctx)
|
||||
}
|
||||
|
||||
func exportCflags(ctx variableAssignmentContext) error {
|
||||
// The Soong replacement for EXPORT_CFLAGS doesn't need the same extra escaped quotes that were present in Make
|
||||
ctx.mkvalue = ctx.mkvalue.Clone()
|
||||
ctx.mkvalue.ReplaceLiteral(`\"`, `"`)
|
||||
return includeVariableNow(bpVariable{"export_cflags", bpparser.ListType}, ctx)
|
||||
}
|
||||
|
||||
func protoOutputParams(ctx variableAssignmentContext) error {
|
||||
// The Soong replacement for LOCAL_PROTO_JAVA_OUTPUT_PARAMS doesn't need ","
|
||||
ctx.mkvalue = ctx.mkvalue.Clone()
|
||||
|
@@ -197,6 +197,9 @@ type FlagExporterProperties struct {
|
||||
// using -isystem for this module and any module that links against this module.
|
||||
Export_system_include_dirs []string `android:"arch_variant,variant_prepend"`
|
||||
|
||||
// list of plain cc flags to be used for any module that links against this module.
|
||||
Export_cflags []string `android:"arch_variant"`
|
||||
|
||||
Target struct {
|
||||
Vendor, Product struct {
|
||||
// list of exported include directories, like
|
||||
@@ -307,6 +310,10 @@ func (f *flagExporter) exportIncludes(ctx ModuleContext) {
|
||||
f.systemDirs = append(f.systemDirs, android.PathsForModuleSrc(ctx, f.Properties.Export_system_include_dirs)...)
|
||||
}
|
||||
|
||||
func (f *flagExporter) exportExtraFlags(ctx ModuleContext) {
|
||||
f.flags = append(f.flags, f.Properties.Export_cflags...)
|
||||
}
|
||||
|
||||
// exportIncludesAsSystem registers the include directories and system include directories to be
|
||||
// exported transitively both as system include directories to modules depending on this module.
|
||||
func (f *flagExporter) exportIncludesAsSystem(ctx ModuleContext) {
|
||||
@@ -1623,6 +1630,7 @@ func (library *libraryDecorator) link(ctx ModuleContext,
|
||||
|
||||
// Export include paths and flags to be propagated up the tree.
|
||||
library.exportIncludes(ctx)
|
||||
library.exportExtraFlags(ctx)
|
||||
library.reexportDirs(deps.ReexportedDirs...)
|
||||
library.reexportSystemDirs(deps.ReexportedSystemDirs...)
|
||||
library.reexportFlags(deps.ReexportedFlags...)
|
||||
|
Reference in New Issue
Block a user