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

Commit c275b81f authored by Chih-hung Hsieh's avatar Chih-hung Hsieh Committed by Gerrit Code Review
Browse files

Merge "no out/soong/... in default header-filter"

parents 4d92d831 5fe637aa
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -96,10 +96,15 @@ func (tidy *tidyFeature) flags(ctx ModuleContext, flags Flags) Flags {
	if !android.SubstringInList(flags.TidyFlags, "-header-filter=") {
		defaultDirs := ctx.Config().Getenv("DEFAULT_TIDY_HEADER_DIRS")
		headerFilter := "-header-filter="
		// Default header filter should include only the module directory,
		// not the out/soong/.../ModuleDir/...
		// Otherwise, there will be too many warnings from generated files in out/...
		// If a module wants to see warnings in the generated source files,
		// it should specify its own -header-filter flag.
		if defaultDirs == "" {
			headerFilter += ctx.ModuleDir() + "/"
			headerFilter += "^" + ctx.ModuleDir() + "/"
		} else {
			headerFilter += "\"(" + ctx.ModuleDir() + "/|" + defaultDirs + ")\""
			headerFilter += "\"(^" + ctx.ModuleDir() + "/|" + defaultDirs + ")\""
		}
		flags.TidyFlags = append(flags.TidyFlags, headerFilter)
	}