summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorDaniel Erat <derat@google.com>2015-08-17 20:43:00 -0600
committerDaniel Erat <derat@google.com>2015-08-19 22:11:54 +0000
commitf0d9a7aa9bcf9e047928bf55d2174eebd1a14aa6 (patch)
treec55a1998758ab0374101acc0f464e4e02c0b134d /build
parent3ca9d0096f5618f5bbad8b1363a069d13fc3026e (diff)
downloadlibchrome-f0d9a7aa9bcf9e047928bf55d2174eebd1a14aa6.tar.gz
Enable logging and use __ANDROID__ instead of __BRILLO__.
Drop the __BRILLO__ #define, instead using the existing __ANDROID__ define set by the toolchain and setting a new __ANDROID_HOST__ define when building for the host. Also use Android logging when __ANDROID__ is defined. Bug: 23358460 Change-Id: I0d86eac8af381b002a3d46d8a95434c7e24518bd
Diffstat (limited to 'build')
-rw-r--r--build/build_config.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/build/build_config.h b/build/build_config.h
index 5181b2bf46..bf3f43ee4f 100644
--- a/build/build_config.h
+++ b/build/build_config.h
@@ -15,19 +15,30 @@
#ifndef BUILD_BUILD_CONFIG_H_
#define BUILD_BUILD_CONFIG_H_
-// Add Brillo-specific defines.
-#if defined(__BRILLO__)
+// A brief primer on #defines:
+//
+// - __ANDROID__ is automatically defined by the Android toolchain (see
+// https://goo.gl/v61lXa). It's not defined when building host code.
+// - __ANDROID_HOST__ is defined via -D by Android.mk when building host code
+// within an Android checkout.
+// - ANDROID is defined via -D when building code for either Android targets or
+// hosts. Use __ANDROID__ and __ANDROID_HOST__ instead.
+// - OS_ANDROID is a Chrome-specific define used to build Chrome for Android
+// within the NDK.
+#if defined(__ANDROID__)
#define __linux__ 1
-#define NO_TCMALLOC
-// Unset ANDROID, which is just used for building Chrome on Android.
-#undef ANDROID
+
+// The Chrome OS implementation of this library is currently built on Android.
+#define OS_CHROMEOS 1
#if defined(__BIONIC__)
#define __UCLIBC__ 1
-#define OS_CHROMEOS 1
-#endif // __BIONIC__
+#endif // defined(__BIONIC__)
+#endif // defined(__ANDROID__)
-#endif
+#if defined(__ANDROID__) || defined(__ANDROID_HOST__)
+#define NO_TCMALLOC
+#endif // defined(__ANDROID__) || defined(__ANDROID_HOST__)
// A set of macros to use for platform detection.
#if defined(__native_client__)
@@ -41,8 +52,6 @@
#else
#define OS_NACL_SFI
#endif
-#elif defined(ANDROID)
-#define OS_ANDROID 1
#elif defined(__APPLE__)
// only include TargetConditions after testing ANDROID as some android builds
// on mac don't have this header available and it's not needed unless the target