Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26c165bf authored by Alessandro Astone's avatar Alessandro Astone Committed by Nolen Johnson
Browse files

soong: Add equivalent for LOCAL_EXPORT_CFLAGS

Change-Id: Ieb3e5739b50789bdbaf41a7d5adb04b08f7b9ea2
parent bec7d52d
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -61,6 +61,7 @@ var rewriteProperties = map[string](func(variableAssignmentContext) error){
	"LOCAL_SANITIZE_DIAG":                  sanitize("diag."),
	"LOCAL_SANITIZE_DIAG":                  sanitize("diag."),
	"LOCAL_STRIP_MODULE":                   strip(),
	"LOCAL_STRIP_MODULE":                   strip(),
	"LOCAL_CFLAGS":                         cflags,
	"LOCAL_CFLAGS":                         cflags,
	"LOCAL_EXPORT_CFLAGS":                  exportCflags,
	"LOCAL_UNINSTALLABLE_MODULE":           invert("installable"),
	"LOCAL_UNINSTALLABLE_MODULE":           invert("installable"),
	"LOCAL_PROGUARD_ENABLED":               proguardEnabled,
	"LOCAL_PROGUARD_ENABLED":               proguardEnabled,
	"LOCAL_MODULE_PATH":                    prebuiltModulePath,
	"LOCAL_MODULE_PATH":                    prebuiltModulePath,
@@ -721,6 +722,13 @@ func cflags(ctx variableAssignmentContext) error {
	return includeVariableNow(bpVariable{"cflags", bpparser.ListType}, ctx)
	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 proguardEnabled(ctx variableAssignmentContext) error {
func proguardEnabled(ctx variableAssignmentContext) error {
	val, err := makeVariableToBlueprint(ctx.file, ctx.mkvalue, bpparser.ListType)
	val, err := makeVariableToBlueprint(ctx.file, ctx.mkvalue, bpparser.ListType)
	if err != nil {
	if err != nil {
+8 −0
Original line number Original line Diff line number Diff line
@@ -192,6 +192,9 @@ type FlagExporterProperties struct {
	// using -isystem for this module and any module that links against this module.
	// using -isystem for this module and any module that links against this module.
	Export_system_include_dirs []string `android:"arch_variant"`
	Export_system_include_dirs []string `android:"arch_variant"`


	// list of plain cc flags to be used for any module that links against this module.
	Export_cflags []string  `android:"arch_variant"`

	Target struct {
	Target struct {
		Vendor, Product struct {
		Vendor, Product struct {
			// list of exported include directories, like
			// list of exported include directories, like
@@ -402,6 +405,10 @@ func (f *flagExporter) exportIncludes(ctx ModuleContext) {
	f.systemDirs = append(f.systemDirs, android.PathsForModuleSrc(ctx, f.Properties.Export_system_include_dirs)...)
	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
// exportIncludesAsSystem registers the include directories and system include directories to be
// exported transitively both as system include directories to modules depending on this module.
// exported transitively both as system include directories to modules depending on this module.
func (f *flagExporter) exportIncludesAsSystem(ctx ModuleContext) {
func (f *flagExporter) exportIncludesAsSystem(ctx ModuleContext) {
@@ -1507,6 +1514,7 @@ func (library *libraryDecorator) link(ctx ModuleContext,


	// Export include paths and flags to be propagated up the tree.
	// Export include paths and flags to be propagated up the tree.
	library.exportIncludes(ctx)
	library.exportIncludes(ctx)
	library.exportExtraFlags(ctx)
	library.reexportDirs(deps.ReexportedDirs...)
	library.reexportDirs(deps.ReexportedDirs...)
	library.reexportSystemDirs(deps.ReexportedSystemDirs...)
	library.reexportSystemDirs(deps.ReexportedSystemDirs...)
	library.reexportFlags(deps.ReexportedFlags...)
	library.reexportFlags(deps.ReexportedFlags...)