Cherrypick "Don't include TargetConditionals.h when building for android."
> Move the include of the Mac TargetConditionals.h file to after we've
> checked if we're building for Android. Apparently this file doesn't
> exist on all macs used to build android and the rest of android builds
> fine without it, so including it there causes the build to fail. It
> appears to only be used to test TARGET_OS_IPHONE which will never be
> true on android.
>
> BUG=
>
> Review URL: https://codereview.chromium.org/538563002
>
> Cr-Commit-Position: refs/heads/master@{#293495}
Bug: 17401514
diff --git a/build/build_config.h b/build/build_config.h
index 6e31a73..a6c8ef9 100644
--- a/build/build_config.h
+++ b/build/build_config.h
@@ -14,10 +14,6 @@
#ifndef BUILD_BUILD_CONFIG_H_
#define BUILD_BUILD_CONFIG_H_
-#if defined(__APPLE__)
-#include <TargetConditionals.h>
-#endif
-
// A set of macros to use for platform detection.
#if defined(__native_client__)
// __native_client__ must be first, so that other OS_ defines are not set.
@@ -25,6 +21,10 @@
#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
+// is really mac/ios.
+#include <TargetConditionals.h>
#define OS_MACOSX 1
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#define OS_IOS 1