Update mojo sdk to rev 1dc8a9a5db73d3718d99917fadf31f5fb2ebad4f
[chromium-blink-merge.git] / third_party / widevine / cdm / widevine_cdm.gyp
blob97a416518bfb4063443695365f665d6870fa5acd
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.
6   'variables': {
7     # Allow widevinecdmadapter to be built in Chromium.
8     'variables': {
9       'enable_widevine%': 0,
10     },
11     'enable_widevine%': '<(enable_widevine)',
12     'widevine_cdm_version_h_file%': 'widevine_cdm_version.h',
13     'widevine_cdm_binary_files%': [],
14     'conditions': [
15       [ 'branding == "Chrome"', {
16         'conditions': [
17           [ 'chromeos == 1', {
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',
22             ],
23           }],
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',
29             ],
30           }],
31           [ 'OS == "mac"', {
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',
36             ],
37           }],
38           [ 'OS == "win"', {
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',
44             ],
45           }],
46         ],
47       }],
48       [ 'OS == "android"', {
49         'widevine_cdm_version_h_file%':
50             'android/widevine_cdm_version.h',
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       }],
59     ],
60   },
61   'includes': [
62     '../../../build/util/version.gypi',
63   ],
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).
67   'targets': [
68     {
69       # GN version: //third_party/widevine/cdm:widevinecdmadapter_resources
70       'target_name': 'widevinecdmadapter_resources',
71       'type': 'none',
72       'variables': {
73         'output_dir': '.',
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
78       },
79       'sources': [
80         'widevinecdmadapter.ver',
81       ],
82       'includes': [
83         '../../../chrome/version_resource_rules.gypi',
84       ],
85     },
86     {
87       # GN version: //third_party/widevine/cdm:widevinecdmadapter
88       'target_name': 'widevinecdmadapter',
89       'type': 'none',
90       'conditions': [
91         [ '(branding == "Chrome" or enable_widevine == 1) and enable_pepper_cdms == 1', {
92           'dependencies': [
93             '<(DEPTH)/ppapi/ppapi.gyp:ppapi_cpp',
94             '<(DEPTH)/media/media_cdm_adapter.gyp:cdmadapter',
95             'widevine_cdm_version_h',
96             'widevinecdm',
97             'widevinecdmadapter_resources',
98           ],
99           'sources': [
100             '<(SHARED_INTERMEDIATE_DIR)/widevinecdmadapter_version.rc',
101           ],
102           'conditions': [
103             [ 'os_posix == 1 and OS != "mac"', {
104               'libraries': [
105                 '-lrt',
106                 # Copied/created by widevinecdm.
107                 '<(PRODUCT_DIR)/libwidevinecdm.so',
108               ],
109             }],
110             [ 'OS == "win"', {
111               'libraries': [
112                 # Copied/created by widevinecdm.
113                 '<(PRODUCT_DIR)/widevinecdm.dll.lib',
114               ],
115             }],
116             [ 'OS == "mac"', {
117               'libraries': [
118                 # Copied/created by widevinecdm.
119                 '<(PRODUCT_DIR)/libwidevinecdm.dylib',
120               ],
121             }],
122           ],
123         }],
124       ],
125     },
126     {
127       # GN version: //third_party/widevine/cdm:version_h
128       'target_name': 'widevine_cdm_version_h',
129       'type': 'none',
130       'copies': [{
131         'destination': '<(SHARED_INTERMEDIATE_DIR)',
132         'files': [ '<(widevine_cdm_version_h_file)' ],
133       }],
134     },
135     {
136       # GN version: //third_party/widevine/cdm:widevinecdm
137       'target_name': 'widevinecdm',
138       'type': 'none',
139       'conditions': [
140         [ 'branding == "Chrome"', {
141           'conditions': [
142             [ 'OS=="mac"', {
143               'xcode_settings': {
144                 'COPY_PHASE_STRIP': 'NO',
145               }
146             }],
147           ],
148           'copies': [{
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)' ],
153           }],
154         }],
155         [ 'branding != "Chrome" and enable_widevine == 1', {
156           'conditions': [
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
161               # above.
162             }],
163             ['OS == "mac" or OS == "win"', {
164               'type': 'shared_library',
165             }],
166             ['OS == "mac"', {
167               'xcode_settings': {
168                 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
169               },
170             }],
171           ],
172           'defines': ['CDM_IMPLEMENTATION'],
173           'dependencies': [
174             'widevine_cdm_version_h',
175             '<(DEPTH)/base/base.gyp:base',
176           ],
177           'sources': [
178             '<(DEPTH)/media/cdm/stub/stub_cdm.cc',
179             '<(DEPTH)/media/cdm/stub/stub_cdm.h',
180           ],
181         }],
182       ],
183     },
184     {
185       # GN version: //third_party/widevine/cdm:widevine_test_license_server
186       'target_name': 'widevine_test_license_server',
187       'type': 'none',
188       'conditions': [
189         [ 'branding == "Chrome" and OS == "linux"', {
190           'dependencies': [
191             '<(DEPTH)/third_party/widevine/test/license_server/license_server.gyp:test_license_server',
192           ],
193         }],
194       ],
195     },
196   ],