Home | History | Annotate | Download | only in cdm
      1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 {
      6   'variables': {
      7     'widevine_cdm_version_h_file%': 'widevine_cdm_version.h',
      8     'widevine_cdm_binary_files%': [],
      9     'conditions': [
     10       [ 'branding == "Chrome"', {
     11         'conditions': [
     12           [ 'chromeos == 1', {
     13             'widevine_cdm_version_h_file%':
     14                 'symbols/chromeos/<(target_arch)/widevine_cdm_version.h',
     15             'widevine_cdm_binary_files%': [
     16               'binaries/chromeos/<(target_arch)/libwidevinecdm.so',
     17             ],
     18           }],
     19           [ 'OS == "linux" and chromeos == 0', {
     20             'widevine_cdm_version_h_file%':
     21                 'symbols/linux/<(target_arch)/widevine_cdm_version.h',
     22             'widevine_cdm_binary_files%': [
     23               'binaries/linux/<(target_arch)/libwidevinecdm.so',
     24             ],
     25           }],
     26           [ 'OS == "mac"', {
     27             'widevine_cdm_version_h_file%':
     28                 'symbols/mac/<(target_arch)/widevine_cdm_version.h',
     29             'widevine_cdm_binary_files%': [
     30               'binaries/mac/<(target_arch)/libwidevinecdm.dylib',
     31             ],
     32           }],
     33           [ 'OS == "win"', {
     34             'widevine_cdm_version_h_file%':
     35                 'symbols/win/<(target_arch)/widevine_cdm_version.h',
     36             'widevine_cdm_binary_files%': [
     37               'binaries/win/<(target_arch)/widevinecdm.dll',
     38               'binaries/win/<(target_arch)/widevinecdm.dll.lib',
     39             ],
     40           }],
     41         ],
     42       }],
     43     ],
     44   },
     45   # Always provide a target, so we can put the logic about whether there's
     46   # anything to be done in this file (instead of a higher-level .gyp file).
     47   'targets': [
     48     {
     49       'target_name': 'widevinecdmadapter',
     50       'type': 'none',
     51       'conditions': [
     52         [ 'branding == "Chrome" and enable_pepper_cdms==1', {
     53           'dependencies': [
     54             '<(DEPTH)/ppapi/ppapi.gyp:ppapi_cpp',
     55             'widevine_cdm_version_h',
     56             'widevine_cdm_binaries',
     57           ],
     58           'sources': [
     59             '<(DEPTH)/media/cdm/ppapi/api/content_decryption_module.h',
     60             '<(DEPTH)/media/cdm/ppapi/cdm_wrapper.cc',
     61             '<(DEPTH)/media/cdm/ppapi/linked_ptr.h',
     62           ],
     63           'conditions': [
     64             [ 'os_posix == 1 and OS != "mac"', {
     65               'cflags': ['-fvisibility=hidden'],
     66               'type': 'loadable_module',
     67               # Allow the plugin wrapper to find the CDM in the same directory.
     68               'ldflags': ['-Wl,-rpath=\$$ORIGIN'],
     69               'libraries': [
     70                 # Copied by widevine_cdm_binaries.
     71                 '<(PRODUCT_DIR)/libwidevinecdm.so',
     72               ],
     73             }],
     74             [ 'OS == "win"', {
     75               'type': 'shared_library',
     76               # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
     77               'msvs_disabled_warnings': [ 4267, ],
     78               'libraries': [
     79                 # Copied by widevine_cdm_binaries.
     80                 '<(PRODUCT_DIR)/widevinecdm.dll.lib',
     81               ],
     82             }],
     83             [ 'OS == "mac"', {
     84               'type': 'loadable_module',
     85               'product_extension': 'plugin',
     86               'libraries': [
     87                 # Copied by widevine_cdm_binaries.
     88                 '<(PRODUCT_DIR)/libwidevinecdm.dylib',
     89               ],
     90               'xcode_settings': {
     91                 'OTHER_LDFLAGS': [
     92                   # Not to strip important symbols by -Wl,-dead_strip.
     93                   '-Wl,-exported_symbol,_PPP_GetInterface',
     94                   '-Wl,-exported_symbol,_PPP_InitializeModule',
     95                   '-Wl,-exported_symbol,_PPP_ShutdownModule',
     96                 ],
     97                 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
     98               },
     99             }],
    100           ],
    101         }],
    102       ],
    103     },
    104     {
    105       'target_name': 'widevine_cdm_version_h',
    106       'type': 'none',
    107       'copies': [{
    108         'destination': '<(SHARED_INTERMEDIATE_DIR)',
    109         'files': [ '<(widevine_cdm_version_h_file)' ],
    110       }],
    111     },
    112     {
    113       'target_name': 'widevine_cdm_binaries',
    114       'type': 'none',
    115       'conditions': [
    116         [ 'OS=="mac"', {
    117           'xcode_settings': {
    118             'COPY_PHASE_STRIP': 'NO',
    119           }
    120         }],
    121       ],
    122       'copies': [{
    123         # TODO(ddorwin): Do we need a sub-directory? We either need a
    124         # sub-directory or to rename manifest.json before we can copy it.
    125         'destination': '<(PRODUCT_DIR)',
    126         'files': [ '<@(widevine_cdm_binary_files)' ],
    127       }],
    128     },
    129   ],
    130 }
    131