OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'variables': { | 6 'variables': { |
| 7 # Allow widevinecdmadapter to be built in Chromium. |
| 8 'variables': { |
| 9 'enable_widevine%': 0, |
| 10 }, |
| 11 'enable_widevine%': '<(enable_widevine)', |
7 'widevine_cdm_version_h_file%': 'widevine_cdm_version.h', | 12 'widevine_cdm_version_h_file%': 'widevine_cdm_version.h', |
8 'widevine_cdm_binary_files%': [], | 13 'widevine_cdm_binary_files%': [], |
9 'conditions': [ | 14 'conditions': [ |
10 [ 'branding == "Chrome"', { | 15 [ 'branding == "Chrome"', { |
11 'conditions': [ | 16 'conditions': [ |
12 [ 'chromeos == 1', { | 17 [ 'chromeos == 1', { |
13 'widevine_cdm_version_h_file%': | 18 'widevine_cdm_version_h_file%': |
14 'chromeos/<(target_arch)/widevine_cdm_version.h', | 19 'chromeos/<(target_arch)/widevine_cdm_version.h', |
15 'widevine_cdm_binary_files%': [ | 20 'widevine_cdm_binary_files%': [ |
16 'chromeos/<(target_arch)/libwidevinecdm.so', | 21 'chromeos/<(target_arch)/libwidevinecdm.so', |
(...skipping 20 matching lines...) Expand all Loading... |
37 'win/<(target_arch)/widevinecdm.dll', | 42 'win/<(target_arch)/widevinecdm.dll', |
38 'win/<(target_arch)/widevinecdm.dll.lib', | 43 'win/<(target_arch)/widevinecdm.dll.lib', |
39 ], | 44 ], |
40 }], | 45 }], |
41 ], | 46 ], |
42 }], | 47 }], |
43 [ 'OS == "android"', { | 48 [ 'OS == "android"', { |
44 'widevine_cdm_version_h_file%': | 49 'widevine_cdm_version_h_file%': |
45 'android/widevine_cdm_version.h', | 50 'android/widevine_cdm_version.h', |
46 }], | 51 }], |
| 52 [ 'branding != "Chrome" and OS != "android" and enable_widevine == 1', { |
| 53 # If enable_widevine==1 then create a dummy widevinecdm. On Win/Mac |
| 54 # the component updater will get the latest version and use it. |
| 55 # Other systems are not currently supported. |
| 56 'widevine_cdm_version_h_file%': |
| 57 'stub/widevine_cdm_version.h', |
| 58 }], |
47 ], | 59 ], |
48 }, | 60 }, |
49 'includes': [ | 61 'includes': [ |
50 '../../../build/util/version.gypi', | 62 '../../../build/util/version.gypi', |
51 ], | 63 ], |
52 | 64 |
53 # Always provide a target, so we can put the logic about whether there's | 65 # Always provide a target, so we can put the logic about whether there's |
54 # anything to be done in this file (instead of a higher-level .gyp file). | 66 # anything to be done in this file (instead of a higher-level .gyp file). |
55 'targets': [ | 67 'targets': [ |
56 { | 68 { |
(...skipping 22 matching lines...) Expand all Loading... |
79 ], | 91 ], |
80 'includes': [ | 92 'includes': [ |
81 '../../../chrome/version_resource_rules.gypi', | 93 '../../../chrome/version_resource_rules.gypi', |
82 ], | 94 ], |
83 }, | 95 }, |
84 { | 96 { |
85 # GN version: //third_party/widevine/cdm:adapter | 97 # GN version: //third_party/widevine/cdm:adapter |
86 'target_name': 'widevinecdmadapter', | 98 'target_name': 'widevinecdmadapter', |
87 'type': 'none', | 99 'type': 'none', |
88 'conditions': [ | 100 'conditions': [ |
89 [ 'branding == "Chrome" and enable_pepper_cdms==1', { | 101 [ '(branding == "Chrome" or enable_widevine == 1) and enable_pepper_cdms
== 1', { |
90 'dependencies': [ | 102 'dependencies': [ |
91 '<(DEPTH)/ppapi/ppapi.gyp:ppapi_cpp', | 103 '<(DEPTH)/ppapi/ppapi.gyp:ppapi_cpp', |
92 '<(DEPTH)/media/media_cdm_adapter.gyp:cdmadapter', | 104 '<(DEPTH)/media/media_cdm_adapter.gyp:cdmadapter', |
93 'widevine_cdm_version_h', | 105 'widevine_cdm_version_h', |
94 'widevine_cdm_binaries', | 106 'widevinecdm', |
95 'widevinecdmadapter_resources', | 107 'widevinecdmadapter_resources', |
96 ], | 108 ], |
97 'sources': [ | 109 'sources': [ |
98 '<(SHARED_INTERMEDIATE_DIR)/widevinecdmadapter_version.rc', | 110 '<(SHARED_INTERMEDIATE_DIR)/widevinecdmadapter_version.rc', |
99 ], | 111 ], |
100 'conditions': [ | 112 'conditions': [ |
101 [ 'os_posix == 1 and OS != "mac"', { | 113 [ 'os_posix == 1 and OS != "mac"', { |
102 'libraries': [ | 114 'libraries': [ |
103 '-lrt', | 115 '-lrt', |
104 # Copied by widevine_cdm_binaries. | 116 # Copied/created by widevinecdm. |
105 '<(PRODUCT_DIR)/libwidevinecdm.so', | 117 '<(PRODUCT_DIR)/libwidevinecdm.so', |
106 ], | 118 ], |
107 }], | 119 }], |
108 [ 'OS == "win"', { | 120 [ 'OS == "win"', { |
109 'libraries': [ | 121 'libraries': [ |
110 # Copied by widevine_cdm_binaries. | 122 # Copied/created by widevinecdm. |
111 '<(PRODUCT_DIR)/widevinecdm.dll.lib', | 123 '<(PRODUCT_DIR)/widevinecdm.dll.lib', |
112 ], | 124 ], |
113 }], | 125 }], |
114 [ 'OS == "mac"', { | 126 [ 'OS == "mac"', { |
115 'libraries': [ | 127 'libraries': [ |
116 # Copied by widevine_cdm_binaries. | 128 # Copied/created by widevinecdm. |
117 '<(PRODUCT_DIR)/libwidevinecdm.dylib', | 129 '<(PRODUCT_DIR)/libwidevinecdm.dylib', |
118 ], | 130 ], |
119 }], | 131 }], |
120 ], | 132 ], |
121 }], | 133 }], |
122 ], | 134 ], |
123 }, | 135 }, |
124 { | 136 { |
125 # GN version: //third_party/widevine/cdm:version_h | 137 # GN version: //third_party/widevine/cdm:version_h |
126 'target_name': 'widevine_cdm_version_h', | 138 'target_name': 'widevine_cdm_version_h', |
127 'type': 'none', | 139 'type': 'none', |
128 'copies': [{ | 140 'copies': [{ |
129 'destination': '<(SHARED_INTERMEDIATE_DIR)', | 141 'destination': '<(SHARED_INTERMEDIATE_DIR)', |
130 'files': [ '<(widevine_cdm_version_h_file)' ], | 142 'files': [ '<(widevine_cdm_version_h_file)' ], |
131 }], | 143 }], |
132 }, | 144 }, |
133 { | 145 { |
134 # GN version: //third_party/widevine/cdm:binaries | 146 # GN version: //third_party/widevine/cdm:binaries |
135 'target_name': 'widevine_cdm_binaries', | 147 'target_name': 'widevinecdm', |
136 'type': 'none', | 148 'type': 'none', |
137 'conditions': [ | 149 'conditions': [ |
138 [ 'OS=="mac"', { | 150 [ 'branding == "Chrome"', { |
139 'xcode_settings': { | 151 'conditions': [ |
140 'COPY_PHASE_STRIP': 'NO', | 152 [ 'OS=="mac"', { |
141 } | 153 'xcode_settings': { |
| 154 'COPY_PHASE_STRIP': 'NO', |
| 155 } |
| 156 }], |
| 157 ], |
| 158 'copies': [{ |
| 159 # TODO(ddorwin): Do we need a sub-directory? We either need a |
| 160 # sub-directory or to rename manifest.json before we can copy it. |
| 161 'destination': '<(PRODUCT_DIR)', |
| 162 'files': [ '<@(widevine_cdm_binary_files)' ], |
| 163 }], |
| 164 }], |
| 165 [ 'branding != "Chrome" and enable_widevine == 1', { |
| 166 'conditions': [ |
| 167 ['os_posix == 1 and OS != "mac"', { |
| 168 'type': 'loadable_module', |
| 169 # Note that this causes the binary to be put in PRODUCT_DIR |
| 170 # instead of lib/. This matches what happens in the copy step |
| 171 # above. |
| 172 }], |
| 173 ['OS == "mac" or OS == "win"', { |
| 174 'type': 'shared_library', |
| 175 }], |
| 176 ['OS == "mac"', { |
| 177 'xcode_settings': { |
| 178 'DYLIB_INSTALL_NAME_BASE': '@loader_path', |
| 179 }, |
| 180 }], |
| 181 ], |
| 182 'defines': ['CDM_IMPLEMENTATION'], |
| 183 'dependencies': [ |
| 184 '<(DEPTH)/base/base.gyp:base', |
| 185 ], |
| 186 'sources': [ |
| 187 '<(DEPTH)/media/cdm/stub/stub_cdm.cc', |
| 188 '<(DEPTH)/media/cdm/stub/stub_cdm.h', |
| 189 ], |
142 }], | 190 }], |
143 ], | 191 ], |
144 'copies': [{ | |
145 # TODO(ddorwin): Do we need a sub-directory? We either need a | |
146 # sub-directory or to rename manifest.json before we can copy it. | |
147 'destination': '<(PRODUCT_DIR)', | |
148 'files': [ '<@(widevine_cdm_binary_files)' ], | |
149 }], | |
150 }, | 192 }, |
151 { | 193 { |
152 'target_name': 'widevine_test_license_server', | 194 'target_name': 'widevine_test_license_server', |
153 'type': 'none', | 195 'type': 'none', |
154 'conditions': [ | 196 'conditions': [ |
155 [ 'branding == "Chrome" and OS == "linux"', { | 197 [ 'branding == "Chrome" and OS == "linux"', { |
156 'dependencies': [ | 198 'dependencies': [ |
157 '<(DEPTH)/third_party/widevine/test/license_server/license_server.gy
p:test_license_server', | 199 '<(DEPTH)/third_party/widevine/test/license_server/license_server.gy
p:test_license_server', |
158 ], | 200 ], |
159 }], | 201 }], |
160 ], | 202 ], |
161 }, | 203 }, |
162 ], | 204 ], |
163 } | 205 } |
OLD | NEW |