Roll src/third_party/WebKit fc1d527:f73ea91 (svn 188133:188166)
[chromium-blink-merge.git] / media / media_cdm_adapter.gyp
blobbb21c96736d0ab56c3be9c10c0355182fd910071
1 # Copyright 2013 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.
5 # This file defines a common base target for all CDM adapter implementations.
6 # We use 'direct_dependent_settings' to override target type and settings so
7 # that all CDM adapter implementations have the correct type and settings
8 # automatically.
10 # WARNING: Keep 'cdmadapter' target out of media.gyp. /build/all.gyp:All depends
11 # directly on media.gyp:*. If 'cdmadapter' is defined in media.gyp, then
12 # 'direct_dependent_settings' will be applied to 'All' target and bad
13 # things happen, e.g. the type of 'All' target becomes a plugin on Mac.
15   'conditions': [
16     ['enable_pepper_cdms==1', {
17       'targets': [
18         {
19           # For GN, we may want a template that defines a target of the right
20           # type with the right dependencies.
21           'target_name': 'cdmadapter',
22           'type': 'none',
23           'direct_dependent_settings': {
24             'sources': [
25               'cdm/ppapi/api/content_decryption_module.h',
26               'cdm/ppapi/cdm_adapter.cc',
27               'cdm/ppapi/cdm_adapter.h',
28               'cdm/ppapi/cdm_file_io_impl.cc',
29               'cdm/ppapi/cdm_file_io_impl.h',
30               'cdm/ppapi/cdm_helpers.cc',
31               'cdm/ppapi/cdm_helpers.h',
32               'cdm/ppapi/cdm_logging.cc',
33               'cdm/ppapi/cdm_logging.h',
34               'cdm/ppapi/cdm_wrapper.h',
35               'cdm/ppapi/linked_ptr.h',
36               'cdm/ppapi/supported_cdm_versions.h',
37             ],
38             'conditions': [
39               ['os_posix == 1 and OS != "mac"', {
40                 'cflags': ['-fvisibility=hidden'],
41                 'type': 'loadable_module',
42                 # Allow the adapter to find the CDM in the same directory.
43                 'ldflags': ['-Wl,-rpath=\$$ORIGIN'],
44               }],
45               ['OS == "win"', {
46                 'type': 'shared_library',
47                 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
48                 'msvs_disabled_warnings': [ 4267, ],
49               }],
50               ['OS == "mac"', {
51                 'type': 'loadable_module',
52                 'product_extension': 'plugin',
53                 'xcode_settings': {
54                   'OTHER_LDFLAGS': [
55                     # Not to strip important symbols by -Wl,-dead_strip.
56                     '-Wl,-exported_symbol,_PPP_GetInterface',
57                     '-Wl,-exported_symbol,_PPP_InitializeModule',
58                     '-Wl,-exported_symbol,_PPP_ShutdownModule'
59                   ],
60                   'DYLIB_INSTALL_NAME_BASE': '@loader_path',
61                 },
62               }],
63             ],
64           },
65         },
66       ],
67     }],
68   ],