From 06f453359a6686e20d00e7ab661e39ce0e0e5bb5 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 16 May 2016 19:32:33 -0700 Subject: [PATCH] Export -D__BRILLO__ to make if necessary Fixes Brillo builds Change-Id: Ia3563b0c9e000d95ed18d05460f5c8c32e04e191 --- cc/makevars.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cc/makevars.go b/cc/makevars.go index ebb19f1a1..97a26def5 100644 --- a/cc/makevars.go +++ b/cc/makevars.go @@ -74,6 +74,10 @@ func makeVarsToolchain(ctx common.MakeVarsContext, secondPrefix string, globalCflags := fmt.Sprintf("${commonGlobalCflags} ${%sGlobalCflags}", hod) + if hod.Device() && Bool(ctx.Config().ProductVariables.Brillo) { + globalCflags += " -D__BRILLO__" + } + ctx.StrictSorted(makePrefix+"GLOBAL_CFLAGS", strings.Join([]string{ toolchain.ToolchainCflags(), globalCflags, @@ -93,6 +97,10 @@ func makeVarsToolchain(ctx common.MakeVarsContext, secondPrefix string, globalClangCflags := fmt.Sprintf("${commonClangGlobalCflags} ${clangExtraCflags} ${%sClangGlobalCflags}", hod) + if hod.Device() && Bool(ctx.Config().ProductVariables.Brillo) { + globalClangCflags += " -D__BRILLO__" + } + ctx.StrictSorted(clangPrefix+"GLOBAL_CFLAGS", strings.Join([]string{ toolchain.ToolchainClangCflags(), globalClangCflags,