Bug 1419581 - Part 4: Allow setting MOZ_ANDROID_GCM in mozconfig. r=chmanchester
This also verifies that we have Google Play Services (via
MOZ_NATIVE_DEVICES=1) if we ask to build with GCM. This was just an
oversight earlier.
MozReview-Commit-ID: BvJi7Sfo4pu
--- a/mobile/android/moz.configure
+++ b/mobile/android/moz.configure
@@ -3,20 +3,24 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
project_flag('MOZ_ANDROID_EXCLUDE_FONTS',
help='Whether to exclude font files from the build',
default=True)
-project_flag('MOZ_ANDROID_GCM',
- help='Enable GCM (Google Cloud Messaging) registration',
- default=True,
- set_for_old_configure=True)
+option(env='MOZ_ANDROID_GCM',
+ help='Enable GCM (Google Cloud Messaging) registration',
+ default=True)
+
+set_config('MOZ_ANDROID_GCM',
+ depends_if('MOZ_ANDROID_GCM')(lambda _: True))
+add_old_configure_assignment('MOZ_ANDROID_GCM',
+ depends_if('MOZ_ANDROID_GCM')(lambda _: True))
option(env='MOZ_NATIVE_DEVICES',
help='Enable second screen support using native Android libraries.',
default=True)
set_config('MOZ_NATIVE_DEVICES',
depends_if('MOZ_NATIVE_DEVICES')(lambda _: True))
add_old_configure_assignment('MOZ_NATIVE_DEVICES',
@@ -153,8 +157,17 @@ def check_android_mma(android_mma,
' building with MOZ_ANDROID_MMA=1')
@depends('MOZ_ANDROID_POCKET',
'--with-pocket-api-keyfile')
def check_android_pocket(android_pocket, pocket_api_keyfile):
if android_pocket and not pocket_api_keyfile:
die('You must specify --with-pocket-api-keyfile=/path/to/keyfile when'
' building with MOZ_ANDROID_POCKET=1')
+
+# Must come after the ../../toolkit/moz.configure.
+@depends('MOZ_ANDROID_GCM', 'MOZ_NATIVE_DEVICES')
+def check_android_gcm(android_gcm,
+ native_devices):
+ if android_gcm:
+ if not native_devices:
+ die('You must specify MOZ_NATIVE_DEVICES=1 when'
+ ' building with MOZ_ANDROID_GCM=1')