Move toolchain and global variables into separate package

Move all of the configuration into a cc/config package

Change-Id: If56fc7242062ed1ce3cb297f78a1e0ef7537373c
This commit is contained in:
Colin Cross
2016-07-29 13:44:28 -07:00
parent f0cfc7b9e4
commit b98c8b0595
21 changed files with 532 additions and 462 deletions

View File

@@ -20,6 +20,8 @@ package cc
import (
"path/filepath"
"strings"
"android/soong/cc/config"
)
// Check for invalid c/conly/cpp/asflags and suggest alternatives. Only use this
@@ -32,7 +34,7 @@ func CheckBadCompilerFlags(ctx BaseModuleContext, prop string, flags []string) {
ctx.PropertyErrorf(prop, "Flag `%s` must start with `-`", flag)
} else if strings.HasPrefix(flag, "-I") || strings.HasPrefix(flag, "-isystem") {
ctx.PropertyErrorf(prop, "Bad flag `%s`, use local_include_dirs or include_dirs instead", flag)
} else if inList(flag, illegalFlags) {
} else if inList(flag, config.IllegalFlags) {
ctx.PropertyErrorf(prop, "Illegal flag `%s`", flag)
} else if strings.Contains(flag, " ") {
args := strings.Split(flag, " ")