diff options
author | Colin Cross <ccross@android.com> | 2017-03-30 15:03:04 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-03-31 00:48:53 +0000 |
commit | c31994825a4846382147931022b2fcd2654e16f6 (patch) | |
tree | 87d1eedfccc80dc20957a4910e047b326b67d200 /cc/cmakelists.go | |
parent | 4a825c7450b2b16f2c55b533065d95a0ea08b6b9 (diff) | |
download | build_soong-c31994825a4846382147931022b2fcd2654e16f6.tar.gz build_soong-c31994825a4846382147931022b2fcd2654e16f6.tar.bz2 build_soong-c31994825a4846382147931022b2fcd2654e16f6.zip |
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
Diffstat (limited to 'cc/cmakelists.go')
-rw-r--r-- | cc/cmakelists.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cc/cmakelists.go b/cc/cmakelists.go index e0192e76..4df9ece9 100644 --- a/cc/cmakelists.go +++ b/cc/cmakelists.go @@ -5,11 +5,12 @@ import ( "android/soong/android" "android/soong/cc/config" - "github.com/google/blueprint" "os" "path" "path/filepath" "strings" + + "github.com/google/blueprint" ) // This singleton generates CMakeLists.txt files. It does so for each blueprint Android.bp resulting in a cc.Module @@ -162,6 +163,10 @@ func generateCLionProject(compiledModule CompiledInterface, ctx blueprint.Single cppParameters := parseCompilerParameters(ccModule.flags.CppFlags, ctx, f) translateToCMake(cppParameters, f, false, true) + f.WriteString("\n# SYSTEM INCLUDE FLAGS:\n") + includeParameters := parseCompilerParameters(ccModule.flags.SystemIncludeFlags, ctx, f) + translateToCMake(includeParameters, f, true, true) + // Add project executable. f.WriteString(fmt.Sprintf("\nadd_executable(%s ${SOURCE_FILES})\n", cleanExecutableName(ccModule.ModuleBase.Name()))) @@ -171,7 +176,6 @@ func cleanExecutableName(s string) string { return strings.Replace(s, "@", "-", -1) } - func translateToCMake(c compilerParameters, f *os.File, cflags bool, cppflags bool) { writeAllIncludeDirectories(c.systemHeaderSearchPath, f, true) writeAllIncludeDirectories(c.headerSearchPath, f, false) |