Add DeviceUsesClang to change clang default
This is equivalent to USE_CLANG_PLATFORM_BUILD in the current build system. Change-Id: Ifaca0f2639871dac834ef603cfade695191cff11
This commit is contained in:
12
cc/cc.go
12
cc/cc.go
@@ -495,8 +495,14 @@ func (c *CCBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha
|
||||
// TODO: debug
|
||||
flags.CFlags = append(flags.CFlags, c.Properties.Release.Cflags...)
|
||||
|
||||
if ctx.Host() && !ctx.ContainsProperty("clang") {
|
||||
flags.Clang = true
|
||||
if !ctx.ContainsProperty("clang") {
|
||||
if ctx.Host() {
|
||||
flags.Clang = true
|
||||
}
|
||||
|
||||
if ctx.Device() && ctx.AConfig().DeviceUsesClang() {
|
||||
flags.Clang = true
|
||||
}
|
||||
}
|
||||
|
||||
if flags.Clang {
|
||||
@@ -1128,7 +1134,7 @@ func (c *CCLibrary) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlag
|
||||
libName := ctx.ModuleName()
|
||||
// GCC for Android assumes that -shared means -Bsymbolic, use -Wl,-shared instead
|
||||
sharedFlag := "-Wl,-shared"
|
||||
if c.Properties.Clang || ctx.Host() {
|
||||
if flags.Clang || ctx.Host() {
|
||||
sharedFlag = "-shared"
|
||||
}
|
||||
if ctx.Device() {
|
||||
|
Reference in New Issue
Block a user