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:widevinecdmadapter_resources
70 'target_name': 'widevinecdmadapter_resources',
74 'branding_path': '../../../chrome/app/theme/<(branding_path_component)/BRANDING',
75 'template_input_path': '../../../chrome/app/chrome_version.rc.version',
76 'extra_variable_files_arguments': [ '-f', 'BRANDING' ],
77 'extra_variable_files': [ 'BRANDING' ], # NOTE: matches that above
80 'widevinecdmadapter.ver',
83 '../../../chrome/version_resource_rules.gypi',
87 # GN version: //third_party/widevine/cdm:widevinecdmadapter
88 'target_name': 'widevinecdmadapter',
91 [ '(branding == "Chrome" or enable_widevine == 1) and enable_pepper_cdms == 1', {
93 '<(DEPTH)/ppapi/ppapi.gyp:ppapi_cpp',
94 '<(DEPTH)/media/media_cdm_adapter.gyp:cdmadapter',
95 'widevine_cdm_version_h',
97 'widevinecdmadapter_resources',
100 '<(SHARED_INTERMEDIATE_DIR)/widevinecdmadapter_version.rc',
103 [ 'os_posix == 1 and OS != "mac"', {
106 # Copied/created by widevinecdm.
107 '<(PRODUCT_DIR)/libwidevinecdm.so',
112 # Copied/created by widevinecdm.
113 '<(PRODUCT_DIR)/widevinecdm.dll.lib',
118 # Copied/created by widevinecdm.
119 '<(PRODUCT_DIR)/libwidevinecdm.dylib',
127 # GN version: //third_party/widevine/cdm:version_h
128 'target_name': 'widevine_cdm_version_h',
131 'destination': '<(SHARED_INTERMEDIATE_DIR)',
132 'files': [ '<(widevine_cdm_version_h_file)' ],
136 # GN version: //third_party/widevine/cdm:widevinecdm
137 'target_name': 'widevinecdm',
140 [ 'branding == "Chrome"', {
144 'COPY_PHASE_STRIP': 'NO',
149 # TODO(ddorwin): Do we need a sub-directory? We either need a
150 # sub-directory or to rename manifest.json before we can copy it.
151 'destination': '<(PRODUCT_DIR)',
152 'files': [ '<@(widevine_cdm_binary_files)' ],
155 [ 'branding != "Chrome" and enable_widevine == 1', {
157 ['os_posix == 1 and OS != "mac"', {
158 'type': 'loadable_module',
159 # Note that this causes the binary to be put in PRODUCT_DIR
160 # instead of lib/. This matches what happens in the copy step
163 ['OS == "mac" or OS == "win"', {
164 'type': 'shared_library',
168 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
172 'defines': ['CDM_IMPLEMENTATION'],
174 'widevine_cdm_version_h',
175 '<(DEPTH)/base/base.gyp:base',
178 '<(DEPTH)/media/cdm/stub/stub_cdm.cc',
179 '<(DEPTH)/media/cdm/stub/stub_cdm.h',
185 # GN version: //third_party/widevine/cdm:widevine_test_license_server
186 'target_name': 'widevine_test_license_server',
189 [ 'branding == "Chrome" and OS == "linux"', {
191 '<(DEPTH)/third_party/widevine/test/license_server/license_server.gyp:test_license_server',