xref: /aosp_15_r20/external/libchrome/libchrome_tools/patch/build_config.patch (revision 635a864187cb8b6c713ff48b7e790a6b21769273)
1*635a8641SAndroid Build Coastguard Worker--- a/build/build_config.h
2*635a8641SAndroid Build Coastguard Worker+++ b/build/build_config.h
3*635a8641SAndroid Build Coastguard Worker@@ -16,6 +16,40 @@
4*635a8641SAndroid Build Coastguard Worker #ifndef BUILD_BUILD_CONFIG_H_
5*635a8641SAndroid Build Coastguard Worker #define BUILD_BUILD_CONFIG_H_
6*635a8641SAndroid Build Coastguard Worker
7*635a8641SAndroid Build Coastguard Worker+// A brief primer on #defines:
8*635a8641SAndroid Build Coastguard Worker+//
9*635a8641SAndroid Build Coastguard Worker+// - __ANDROID__ is automatically defined by the Android toolchain (see
10*635a8641SAndroid Build Coastguard Worker+//   https://goo.gl/v61lXa). It's not defined when building host code.
11*635a8641SAndroid Build Coastguard Worker+// - __ANDROID_HOST__ is defined via -D by Android.mk when building host code
12*635a8641SAndroid Build Coastguard Worker+//   within an Android checkout.
13*635a8641SAndroid Build Coastguard Worker+// - ANDROID is defined via -D when building code for either Android targets or
14*635a8641SAndroid Build Coastguard Worker+//   hosts. Use __ANDROID__ and __ANDROID_HOST__ instead.
15*635a8641SAndroid Build Coastguard Worker+// - OS_ANDROID is a Chrome-specific define used to build Chrome for Android
16*635a8641SAndroid Build Coastguard Worker+//   within the NDK.
17*635a8641SAndroid Build Coastguard Worker+
18*635a8641SAndroid Build Coastguard Worker+// Android targets and hosts don't use tcmalloc.
19*635a8641SAndroid Build Coastguard Worker+#if defined(__ANDROID__) || defined(__ANDROID_HOST__)
20*635a8641SAndroid Build Coastguard Worker+#define NO_TCMALLOC
21*635a8641SAndroid Build Coastguard Worker+#endif  // defined(__ANDROID__) || defined(__ANDROID_HOST__)
22*635a8641SAndroid Build Coastguard Worker+
23*635a8641SAndroid Build Coastguard Worker+// Use the Chrome OS version of the code for both Android targets and Chrome OS builds.
24*635a8641SAndroid Build Coastguard Worker+#if !defined(__ANDROID_HOST__)
25*635a8641SAndroid Build Coastguard Worker+#define OS_CHROMEOS 1
26*635a8641SAndroid Build Coastguard Worker+#endif  // !defined(__ANDROID_HOST__)
27*635a8641SAndroid Build Coastguard Worker+
28*635a8641SAndroid Build Coastguard Worker+#if defined(__ANDROID__)  // Android targets
29*635a8641SAndroid Build Coastguard Worker+
30*635a8641SAndroid Build Coastguard Worker+#define __linux__ 1
31*635a8641SAndroid Build Coastguard Worker+
32*635a8641SAndroid Build Coastguard Worker+#elif !defined(__ANDROID_HOST__)  // Chrome OS
33*635a8641SAndroid Build Coastguard Worker+
34*635a8641SAndroid Build Coastguard Worker+// TODO: Remove these once the GLib MessageLoopForUI isn't being used:
35*635a8641SAndroid Build Coastguard Worker+// https://crbug.com/361635
36*635a8641SAndroid Build Coastguard Worker+#define USE_GLIB 1
37*635a8641SAndroid Build Coastguard Worker+#define USE_OZONE 1
38*635a8641SAndroid Build Coastguard Worker+
39*635a8641SAndroid Build Coastguard Worker+#endif  // defined(__ANDROID__)
40*635a8641SAndroid Build Coastguard Worker+
41*635a8641SAndroid Build Coastguard Worker // A set of macros to use for platform detection.
42*635a8641SAndroid Build Coastguard Worker #if defined(__native_client__)
43*635a8641SAndroid Build Coastguard Worker // __native_client__ must be first, so that other OS_ defines are not set.
44*635a8641SAndroid Build Coastguard Worker@@ -28,8 +62,7 @@
45*635a8641SAndroid Build Coastguard Worker #else
46*635a8641SAndroid Build Coastguard Worker #define OS_NACL_SFI
47*635a8641SAndroid Build Coastguard Worker #endif
48*635a8641SAndroid Build Coastguard Worker-#elif defined(ANDROID)
49*635a8641SAndroid Build Coastguard Worker-#define OS_ANDROID 1
50*635a8641SAndroid Build Coastguard Worker+// Don't set OS_ANDROID; it's only used when building Chrome for Android.
51*635a8641SAndroid Build Coastguard Worker #elif defined(__APPLE__)
52*635a8641SAndroid Build Coastguard Worker // only include TargetConditions after testing ANDROID as some android builds
53*635a8641SAndroid Build Coastguard Worker // on mac don't have this header available and it's not needed unless the target
54