aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2015-12-15 16:07:43 -0800
committerColin Cross <ccross@android.com>2015-12-15 16:23:07 -0800
commit7b66f1576323b4f9116d46e663e9cfd37973fbcc (patch)
tree50c1660c2b74b9ffc702864e0b43a561402759d2
parent5ba07e8fe47bdbefe4c9a292d1441b9e08170095 (diff)
downloadbuild_soong-7b66f1576323b4f9116d46e663e9cfd37973fbcc.tar.gz
build_soong-7b66f1576323b4f9116d46e663e9cfd37973fbcc.tar.bz2
build_soong-7b66f1576323b4f9116d46e663e9cfd37973fbcc.zip
Add brillo cflags
Add __BRILLO__ to global cflags when building for a brillo product. Bug: 26165350 Change-Id: I0100a8821b763075d1873d0d48fd5bd217afb580
-rw-r--r--cc/cc.go4
-rw-r--r--common/variable.go1
2 files changed, 5 insertions, 0 deletions
diff --git a/cc/cc.go b/cc/cc.go
index b497d66e..6315cbf9 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -581,6 +581,10 @@ func (c *CCBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha
fmt.Sprintf("${%sGlobalCflags}", ctx.HostOrDevice()))
}
+ if Bool(ctx.AConfig().ProductVariables.Brillo) {
+ flags.GlobalFlags = append(flags.GlobalFlags, "-D__BRILLO__")
+ }
+
if ctx.Device() {
if Bool(c.Properties.Rtti) {
flags.CppFlags = append(flags.CppFlags, "-frtti")
diff --git a/common/variable.go b/common/variable.go
index 2c0e0a6a..4f159c50 100644
--- a/common/variable.go
+++ b/common/variable.go
@@ -82,6 +82,7 @@ type productVariables struct {
CrossHostSecondaryArch *string `json:",omitempty"`
Unbundled_build *bool `json:",omitempty"`
+ Brillo *bool `json:",omitempty"`
}
func boolPtr(v bool) *bool {