Fix include order

Include order should be module includes, dependency exported includes,
and then global includes.  Module includes and global includes are
computed during compileFlags, but dependency exported includes are
not handled until later.  Move the global includes into a new
flags variable so that the dependency includes can be appended
to the module includes.

Test: m -j native
Change-Id: Ifc3894f0a898a070d6da8eed4f4b9e8cc0cd2523
This commit is contained in:
Colin Cross
2017-03-30 15:03:04 -07:00
parent 4a825c7450
commit c31994825a
5 changed files with 38 additions and 10 deletions

View File

@@ -201,6 +201,8 @@ type builderFlags struct {
tidy bool
coverage bool
systemIncludeFlags string
groupStaticLibs bool
stripKeepSymbols bool
@@ -244,9 +246,25 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and
coverageFiles = make(android.Paths, 0, len(srcFiles))
}
cflags := flags.globalFlags + " " + flags.cFlags + " " + flags.conlyFlags
cppflags := flags.globalFlags + " " + flags.cFlags + " " + flags.cppFlags
asflags := flags.globalFlags + " " + flags.asFlags
cflags := strings.Join([]string{
flags.globalFlags,
flags.systemIncludeFlags,
flags.cFlags,
flags.conlyFlags,
}, " ")
cppflags := strings.Join([]string{
flags.globalFlags,
flags.systemIncludeFlags,
flags.cFlags,
flags.cppFlags,
}, " ")
asflags := strings.Join([]string{
flags.globalFlags,
flags.systemIncludeFlags,
flags.asFlags,
}, " ")
if flags.clang {
cflags += " ${config.NoOverrideClangGlobalCflags}"