From de6494b9ae4f9d5b803fce0ba5dcb0f765c1f148 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Wed, 16 Dec 2015 15:04:51 -0800 Subject: [PATCH] Define __BRILLO__ only for target modules __ANDROID__ is only defined for target modules, do the same for __BRILLO__. Change-Id: Ie1417e1a5b21c051acf05b2bd3bdb3ddd31be878 --- core/config.mk | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/core/config.mk b/core/config.mk index be2442baa0..556d52b9bc 100644 --- a/core/config.mk +++ b/core/config.mk @@ -186,15 +186,6 @@ include $(BUILD_SYSTEM)/envsetup.mk # See envsetup.mk for a description of SCAN_EXCLUDE_DIRS FIND_LEAVES_EXCLUDES := $(addprefix --prune=, $(OUT_DIR) $(SCAN_EXCLUDE_DIRS) .repo .git) -ifdef BRILLO -# Add a C define that identifies Brillo targets. __BRILLO__ should only be used -# to differentiate between Brillo and non-Brillo-but-Android environments. Use -# __ANDROID__ instead to test if something is being built in an Android-derived -# environment (including Brillo) as opposed to an entirely different -# environment (e.g. Chrome OS). -COMMON_GLOBAL_CFLAGS += -D__BRILLO__ -endif - # --------------------------------------------------------------- # We run gcc/clang with PWD=/proc/self/cwd to remove the $TOP # from the debug output. That way two builds in two different @@ -701,6 +692,18 @@ HOST_CROSS_GLOBAL_CFLAGS += $(HOST_CROSS_RELEASE_CFLAGS) HOST_CROSS_GLOBAL_CPPFLAGS += $(HOST_CROSS_RELEASE_CPPFLAGS) endif +ifdef BRILLO +# Add a C define that identifies Brillo targets. __BRILLO__ should only be used +# to differentiate between Brillo and non-Brillo-but-Android environments. Use +# __ANDROID__ instead to test if something is being built in an Android-derived +# environment (including Brillo) as opposed to an entirely different +# environment (e.g. Chrome OS). +TARGET_GLOBAL_CFLAGS += -D__BRILLO__ +ifdef TARGET_2ND_ARCH +$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CFLAGS += -D__BRILLO__ +endif +endif + # allow overriding default Java libraries on a per-target basis ifeq ($(TARGET_DEFAULT_JAVA_LIBRARIES),) TARGET_DEFAULT_JAVA_LIBRARIES := core-libart core-junit ext framework okhttp