1 # Copyright 2015 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 template defines a CDM adapter target. Just use this as you would a
6 # normal target and everything should work correctly. If GYP, you would instead
7 # depend on media/media_cdm_adapter.gyp:cdmadapter which would in turn modify
8 # your target with direct_dependent_settings.
9 template("cdm_adapter") {
10 # TODO(GYP) On Mac/Linux this should be a loadable_module.
11 shared_library(target_name) {
12 # Don't filter sources list again.
13 set_sources_assignment_filter([])
16 "//media/cdm/ppapi/api/content_decryption_module.h",
17 "//media/cdm/ppapi/cdm_adapter.cc",
18 "//media/cdm/ppapi/cdm_adapter.h",
19 "//media/cdm/ppapi/cdm_file_io_impl.cc",
20 "//media/cdm/ppapi/cdm_file_io_impl.h",
21 "//media/cdm/ppapi/cdm_helpers.cc",
22 "//media/cdm/ppapi/cdm_helpers.h",
23 "//media/cdm/ppapi/cdm_logging.cc",
24 "//media/cdm/ppapi/cdm_logging.h",
25 "//media/cdm/ppapi/cdm_wrapper.h",
26 "//media/cdm/ppapi/linked_ptr.h",
27 "//media/cdm/ppapi/supported_cdm_versions.h",
29 if (defined(invoker.sources)) {
30 sources += invoker.sources
35 # Not to strip important symbols by -Wl,-dead_strip.
36 "-Wl,-exported_symbol,_PPP_GetInterface",
37 "-Wl,-exported_symbol,_PPP_InitializeModule",
38 "-Wl,-exported_symbol,_PPP_ShutdownModule",
40 #TODO(GYP) Mac: 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
41 } else if (is_posix && !is_mac) {
42 cflags = [ "-fvisibility=hidden" ]
43 # Note GYP sets rpath but this is set by default on shared libraries in
47 # TODO(jschuh) crbug.com/167187
48 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
50 if (defined(invoker.all_dependent_configs)) {
51 all_dependent_configs = invoker.all_dependent_configs
53 if (defined(invoker.allow_circular_includes_from)) {
54 allow_circular_includes_from = invoker.allow_circular_includes_from
56 if (defined(invoker.cflags)) {
57 cflags = invoker.cflags
59 if (defined(invoker.cflags_c)) {
60 cflags_c = invoker.cflags_c
62 if (defined(invoker.cflags_cc)) {
63 cflags_cc = invoker.cflags_cc
65 if (defined(invoker.cflags_objc)) {
66 cflags_objc = invoker.cflags_objc
68 if (defined(invoker.cflags_objcc)) {
69 cflags_objcc = invoker.cflags_objcc
71 if (defined(invoker.check_includes)) {
72 check_includes = invoker.check_includes
74 if (defined(invoker.data)) {
77 if (defined(invoker.data_deps)) {
78 data_deps = invoker.data_deps
80 if (defined(invoker.datadeps)) {
81 datadeps = invoker.datadeps
83 if (defined(invoker.defines)) {
84 defines = invoker.defines
86 if (defined(invoker.deps)) {
89 if (defined(invoker.direct_dependent_configs)) {
90 direct_dependent_configs = invoker.direct_dependent_configs
92 if (defined(invoker.forward_dependent_configs_from)) {
93 forward_dependent_configs_from = invoker.forward_dependent_configs_from
95 if (defined(invoker.include_dirs)) {
96 include_dirs = invoker.include_dirs
98 if (defined(invoker.ldflags)) {
99 ldflags = invoker.ldflags
101 if (defined(invoker.lib_dirs)) {
102 lib_dirs = invoker.lib_dirs
104 if (defined(invoker.libs)) {
107 if (defined(invoker.output_extension)) {
108 output_extension = invoker.output_extension
110 if (defined(invoker.output_name)) {
111 output_name = invoker.output_name
113 if (defined(invoker.public)) {
114 public = invoker.public
116 if (defined(invoker.public_configs)) {
117 public_configs = invoker.public_configs
119 if (defined(invoker.public_deps)) {
120 public_deps = invoker.public_deps
122 if (defined(invoker.testonly)) {
123 testonly = invoker.testonly
125 if (defined(invoker.visibility)) {
126 visibility = invoker.visibility