Bug 1295853 - Only enable Widevine on whitelisted Tier-1 build targets. r=glandium a=lizzard
authorChris Pearce <cpearce@mozilla.com>
Wed, 17 Aug 2016 21:40:43 +1200
changeset 349970 abe478444437c9d310eafec265d5f9441c5f13bf
parent 349969 fc6c71b49d556ffd415e3008e626254aa10bbaf8
child 349971 4aacede9f1b374ad665bbb117c1d34e29a1b3992
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, lizzard
bugs1295853
milestone50.0a2
Bug 1295853 - Only enable Widevine on whitelisted Tier-1 build targets. r=glandium a=lizzard MozReview-Commit-ID: 52lrV3aEEVe
toolkit/moz.configure
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -351,28 +351,40 @@ def eme_default(build_project, help):
         return 'widevine'
 
 option('--enable-eme',
        nargs='*',
        choices=('adobe','widevine',),
        default=eme_default,
        help='Enable support for Encrypted Media Extensions')
 
-@depends('--enable-eme', fmp4)
+@depends('--enable-eme', target)
+def enable_eme(value, target):
+    # Widevine EME by default enabled on desktop Windows, MacOS and Linux,
+    # x86 and x64 builds.
+    if (target.kernel in ('Darwin', 'WINNT', 'Linux') and
+        target.os not in ('Android', 'iOS') and
+        target.cpu in ('x86', 'x86_64')):
+        return value
+    elif value and value.origin != 'default':
+        die('%s is not supported on %s' % (value.format('--enable-eme'), target.alias))
+    return value
+
+@depends(enable_eme, fmp4)
 def eme(value, fmp4):
     enabled = bool(value)
     if value.origin == 'default':
         enabled = enabled or fmp4
     if enabled and not fmp4:
         die('Encrypted Media Extension support requires '
             'Fragmented MP4 support')
     if enabled:
         return True
 
-@depends('--enable-eme')
+@depends(enable_eme)
 def eme_modules(value):
     # Theoretically, we could pass `value` directly when it is a
     # PositiveOptionValue, but somehow, the JSON serialization in configure.py
     # outputs inconsistent data in some cases when we do (a closing bracket
     # without an opening one).
     return list(value) if value else []
 
 set_config('MOZ_EME', eme)