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.
7 # Allow widevinecdmadapter to be built in Chromium.
11 'enable_widevine%': '<(enable_widevine)',
12 'widevine_cdm_version_h_file%': 'widevine_cdm_version.h',
13 'widevine_cdm_binary_files%': [],
15 [ 'branding == "Chrome"', {
18 'widevine_cdm_version_h_file%':
19 'chromeos/<(target_arch)/widevine_cdm_version.h',
20 'widevine_cdm_binary_files%': [
21 'chromeos/<(target_arch)/libwidevinecdm.so',
24 [ 'OS == "linux" and chromeos == 0', {
25 'widevine_cdm_version_h_file%':
26 'linux/<(target_arch)/widevine_cdm_version.h',
27 'widevine_cdm_binary_files%': [
28 'linux/<(target_arch)/libwidevinecdm.so',
32 'widevine_cdm_version_h_file%':
33 'mac/<(target_arch)/widevine_cdm_version.h',
34 'widevine_cdm_binary_files%': [
35 'mac/<(target_arch)/libwidevinecdm.dylib',
39 'widevine_cdm_version_h_file%':
40 'win/<(target_arch)/widevine_cdm_version.h',
41 'widevine_cdm_binary_files%': [
42 'win/<(target_arch)/widevinecdm.dll',
43 'win/<(target_arch)/widevinecdm.dll.lib',
48 [ 'OS == "android"', {
49 'widevine_cdm_version_h_file%':
50 'android/widevine_cdm_version.h',
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',
62 '../../../build/util/version.gypi',
65 # Always provide a target, so we can put the logic about whether there's
66 # anything to be done in this file (instead of a higher-level .gyp file).
69 # GN version: //third_party/widevine/cdm:adapter_resources
70 'target_name': 'widevinecdmadapter_resources',
73 ['branding == "Chrome"', {
75 'branding_path': '../../../chrome/app/theme/google_chrome/BRANDING',
77 }, { # else branding!="Chrome"
79 'branding_path': '../../../chrome/app/theme/chromium/BRANDING',
85 'template_input_path': '../../../chrome/app/chrome_version.rc.version',
86 'extra_variable_files_arguments': [ '-f', 'BRANDING' ],
87 'extra_variable_files': [ 'BRANDING' ], # NOTE: matches that above
90 'widevinecdmadapter.ver',
93 '../../../chrome/version_resource_rules.gypi',
97 # GN version: //third_party/widevine/cdm:adapter
98 'target_name': 'widevinecdmadapter',
101 [ '(branding == "Chrome" or enable_widevine == 1) and enable_pepper_cdms == 1', {
103 '<(DEPTH)/ppapi/ppapi.gyp:ppapi_cpp',
104 '<(DEPTH)/media/media_cdm_adapter.gyp:cdmadapter',
105 'widevine_cdm_version_h',
107 'widevinecdmadapter_resources',
110 '<(SHARED_INTERMEDIATE_DIR)/widevinecdmadapter_version.rc',
113 [ 'os_posix == 1 and OS != "mac"', {
116 # Copied/created by widevinecdm.
117 '<(PRODUCT_DIR)/libwidevinecdm.so',
122 # Copied/created by widevinecdm.
123 '<(PRODUCT_DIR)/widevinecdm.dll.lib',
128 # Copied/created by widevinecdm.
129 '<(PRODUCT_DIR)/libwidevinecdm.dylib',
137 # GN version: //third_party/widevine/cdm:version_h
138 'target_name': 'widevine_cdm_version_h',
141 'destination': '<(SHARED_INTERMEDIATE_DIR)',
142 'files': [ '<(widevine_cdm_version_h_file)' ],
146 # GN version: //third_party/widevine/cdm:binaries
147 'target_name': 'widevinecdm',
150 [ 'branding == "Chrome"', {
154 'COPY_PHASE_STRIP': 'NO',
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)' ],
165 [ 'branding != "Chrome" and enable_widevine == 1', {
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
173 ['OS == "mac" or OS == "win"', {
174 'type': 'shared_library',
178 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
182 'defines': ['CDM_IMPLEMENTATION'],
184 '<(DEPTH)/base/base.gyp:base',
187 '<(DEPTH)/media/cdm/stub/stub_cdm.cc',
188 '<(DEPTH)/media/cdm/stub/stub_cdm.h',
194 'target_name': 'widevine_test_license_server',
197 [ 'branding == "Chrome" and OS == "linux"', {
199 '<(DEPTH)/third_party/widevine/test/license_server/license_server.gyp:test_license_server',