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 340502 6c272bb2e85065aea23d9aa24e6b472cafeebe3b
parent 340501 550118c880126785191f842b7a849bfdc5819992
child 340503 90a602a48534fd1d2d164179555bdfa374f02545
push id6351
push userkwierso@gmail.com
push dateMon, 29 Aug 2016 17:22:15 +0000
treeherdermozilla-beta@68d24e6f784c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, lizzard
bugs1295853
milestone49.0
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
@@ -339,28 +339,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)