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 [ 'OS == "android" and google_tv != 1', { 44 'widevine_cdm_version_h_file%': 45 'android/widevine_cdm_version.h', 46 }], 47 ], 48 }, 49 # Always provide a target, so we can put the logic about whether there's 50 # anything to be done in this file (instead of a higher-level .gyp file). 51 'targets': [ 52 { 53 'target_name': 'widevinecdmadapter', 54 'type': 'none', 55 'conditions': [ 56 [ 'branding == "Chrome" and enable_pepper_cdms==1', { 57 'dependencies': [ 58 '<(DEPTH)/ppapi/ppapi.gyp:ppapi_cpp', 59 'widevine_cdm_version_h', 60 'widevine_cdm_binaries', 61 ], 62 'sources': [ 63 '<(DEPTH)/media/cdm/ppapi/api/content_decryption_module.h', 64 '<(DEPTH)/media/cdm/ppapi/cdm_adapter.cc', 65 '<(DEPTH)/media/cdm/ppapi/cdm_adapter.h', 66 '<(DEPTH)/media/cdm/ppapi/cdm_helpers.cc', 67 '<(DEPTH)/media/cdm/ppapi/cdm_helpers.h', 68 '<(DEPTH)/media/cdm/ppapi/cdm_logging.cc', 69 '<(DEPTH)/media/cdm/ppapi/cdm_logging.h', 70 '<(DEPTH)/media/cdm/ppapi/cdm_wrapper.h', 71 '<(DEPTH)/media/cdm/ppapi/linked_ptr.h', 72 '<(DEPTH)/media/cdm/ppapi/supported_cdm_versions.h', 73 ], 74 'conditions': [ 75 [ 'os_posix == 1 and OS != "mac"', { 76 'cflags': ['-fvisibility=hidden'], 77 'type': 'loadable_module', 78 # Allow the plugin adapter to find the CDM in the same directory. 79 'ldflags': ['-Wl,-rpath=\$$ORIGIN'], 80 'libraries': [ 81 # Copied by widevine_cdm_binaries. 82 '<(PRODUCT_DIR)/libwidevinecdm.so', 83 ], 84 }], 85 [ 'OS == "win"', { 86 'type': 'shared_library', 87 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 88 'msvs_disabled_warnings': [ 4267, ], 89 'libraries': [ 90 # Copied by widevine_cdm_binaries. 91 '<(PRODUCT_DIR)/widevinecdm.dll.lib', 92 ], 93 }], 94 [ 'OS == "mac"', { 95 'type': 'loadable_module', 96 'product_extension': 'plugin', 97 'libraries': [ 98 # Copied by widevine_cdm_binaries. 99 '<(PRODUCT_DIR)/libwidevinecdm.dylib', 100 ], 101 'xcode_settings': { 102 'OTHER_LDFLAGS': [ 103 # Not to strip important symbols by -Wl,-dead_strip. 104 '-Wl,-exported_symbol,_PPP_GetInterface', 105 '-Wl,-exported_symbol,_PPP_InitializeModule', 106 '-Wl,-exported_symbol,_PPP_ShutdownModule', 107 ], 108 'DYLIB_INSTALL_NAME_BASE': '@loader_path', 109 }, 110 }], 111 ], 112 }], 113 ], 114 }, 115 { 116 'target_name': 'widevine_cdm_version_h', 117 'type': 'none', 118 'copies': [{ 119 'destination': '<(SHARED_INTERMEDIATE_DIR)', 120 'files': [ '<(widevine_cdm_version_h_file)' ], 121 }], 122 }, 123 { 124 'target_name': 'widevine_cdm_binaries', 125 'type': 'none', 126 'conditions': [ 127 [ 'OS=="mac"', { 128 'xcode_settings': { 129 'COPY_PHASE_STRIP': 'NO', 130 } 131 }], 132 ], 133 'copies': [{ 134 # TODO(ddorwin): Do we need a sub-directory? We either need a 135 # sub-directory or to rename manifest.json before we can copy it. 136 'destination': '<(PRODUCT_DIR)', 137 'files': [ '<@(widevine_cdm_binary_files)' ], 138 }], 139 }, 140 ], 141 } 142