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                'chromeos/<(target_arch)/widevine_cdm_version.h',
15            'widevine_cdm_binary_files%': [
16              'chromeos/<(target_arch)/libwidevinecdm.so',
17            ],
18          }],
19          [ 'OS == "linux" and chromeos == 0', {
20            'widevine_cdm_version_h_file%':
21                'linux/<(target_arch)/widevine_cdm_version.h',
22            'widevine_cdm_binary_files%': [
23              'linux/<(target_arch)/libwidevinecdm.so',
24            ],
25          }],
26          [ 'OS == "mac"', {
27            'widevine_cdm_version_h_file%':
28                'mac/<(target_arch)/widevine_cdm_version.h',
29            'widevine_cdm_binary_files%': [
30              'mac/<(target_arch)/libwidevinecdm.dylib',
31            ],
32          }],
33          [ 'OS == "win"', {
34            'widevine_cdm_version_h_file%':
35                'win/<(target_arch)/widevine_cdm_version.h',
36            'widevine_cdm_binary_files%': [
37              'win/<(target_arch)/widevinecdm.dll',
38              'win/<(target_arch)/widevinecdm.dll.lib',
39            ],
40          }],
41        ],
42      }],
43      [ 'OS == "android"', {
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      # GN version: //third_party/widevine/cdm:adapter
54      'target_name': 'widevinecdmadapter',
55      'type': 'none',
56      'conditions': [
57        [ 'branding == "Chrome" and enable_pepper_cdms==1', {
58          'dependencies': [
59            '<(DEPTH)/ppapi/ppapi.gyp:ppapi_cpp',
60            '<(DEPTH)/media/media_cdm_adapter.gyp:cdmadapter',
61            'widevine_cdm_version_h',
62            'widevine_cdm_binaries',
63          ],
64          'conditions': [
65            [ 'os_posix == 1 and OS != "mac"', {
66              'libraries': [
67                # Copied by widevine_cdm_binaries.
68                '<(PRODUCT_DIR)/libwidevinecdm.so',
69              ],
70            }],
71            [ 'OS == "win"', {
72              'libraries': [
73                # Copied by widevine_cdm_binaries.
74                '<(PRODUCT_DIR)/widevinecdm.dll.lib',
75              ],
76            }],
77            [ 'OS == "mac"', {
78              'libraries': [
79                # Copied by widevine_cdm_binaries.
80                '<(PRODUCT_DIR)/libwidevinecdm.dylib',
81              ],
82            }],
83          ],
84        }],
85      ],
86    },
87    {
88      # GN version: //third_party/widevine/cdm:version_h
89      'target_name': 'widevine_cdm_version_h',
90      'type': 'none',
91      'copies': [{
92        'destination': '<(SHARED_INTERMEDIATE_DIR)',
93        'files': [ '<(widevine_cdm_version_h_file)' ],
94      }],
95    },
96    {
97      # GN version: //third_party/widevine/cdm:binaries
98      'target_name': 'widevine_cdm_binaries',
99      'type': 'none',
100      'conditions': [
101        [ 'OS=="mac"', {
102          'xcode_settings': {
103            'COPY_PHASE_STRIP': 'NO',
104          }
105        }],
106      ],
107      'copies': [{
108        # TODO(ddorwin): Do we need a sub-directory? We either need a
109        # sub-directory or to rename manifest.json before we can copy it.
110        'destination': '<(PRODUCT_DIR)',
111        'files': [ '<@(widevine_cdm_binary_files)' ],
112      }],
113    },
114    {
115      'target_name': 'widevine_test_license_server',
116      'type': 'none',
117      'conditions': [
118        [ 'branding == "Chrome" and OS == "linux"', {
119          'dependencies': [
120            '<(DEPTH)/third_party/widevine/test/license_server/license_server.gyp:test_license_server',
121          ],
122        }],
123      ],
124    },
125  ],
126}
127