base::ManualConstructor improvements
[chromium-blink-merge.git] / media / cdm / ppapi / BUILD.gn
blob5b8339b588e60c9ba2a6ed39b0dd684d1ad339be
1 # Copyright 2014 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 import("//build/config/features.gni")
6 import("//chrome/version.gni")  # TODO layering violation!
7 import("//media/cdm/ppapi/cdm_adapter.gni")
9 # Android doesn't use ffmpeg.
10 use_ffmpeg = !is_android
12 # The GYP version supports build flags "use_fake_video_decoder" and
13 # "use_vpx". These should be added here if necessary but its not clear if
14 # they are required any more.
15 shared_library("clearkeycdm") {
16   sources = [
17     "cdm_file_io_test.cc",
18     "cdm_file_io_test.h",
19     "external_clear_key/cdm_video_decoder.cc",
20     "external_clear_key/cdm_video_decoder.h",
21     "external_clear_key/clear_key_cdm.cc",
22     "external_clear_key/clear_key_cdm.h",
23     "external_clear_key/clear_key_cdm_common.h",
24   ]
26   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
27   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
29   defines = [ "CDM_IMPLEMENTATION" ]
31   deps = [
32     "//base",
33     "//media",  # For media::AudioTimestampHelper
34     "//media:shared_memory_support",  # For media::AudioBus.
35     "//url",
36   ]
38   if (use_ffmpeg) {
39     sources += [
40       "external_clear_key/ffmpeg_cdm_audio_decoder.cc",
41       "external_clear_key/ffmpeg_cdm_audio_decoder.h",
42       "external_clear_key/ffmpeg_cdm_video_decoder.cc",
43       "external_clear_key/ffmpeg_cdm_video_decoder.h",
44     ]
45     defines += [ "CLEAR_KEY_CDM_USE_FFMPEG_DECODER" ]
46     deps += [ "//third_party/ffmpeg" ]
47   }
49   # TODO(GYP) on Mac: 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
52 clearkeycdmadapter_rc_file = "$target_gen_dir/clearkeycdmadapter_version.rc"
54 process_version("clearkeycdmadapter_resources") {
55   visibility = [ ":*" ]
56   sources = [
57     "//media/clearkeycdmadapter.ver",
58     "external_clear_key/BRANDING",
59   ]
60   output = clearkeycdmadapter_rc_file
63 cdm_adapter("clearkeycdmadapter") {
64   sources = [
65     clearkeycdmadapter_rc_file,
66   ]
68   # Check whether the plugin's origin URL is valid.
69   defines = [ "CHECK_DOCUMENT_URL" ]
70   deps = [
71     ":clearkeycdm",
72     ":clearkeycdmadapter_resources",
73     "//ppapi/cpp",
74   ]
76   if (is_posix && !is_mac && enable_pepper_cdms) {
77     # Because clearkeycdm has type 'loadable_module', we must explicitly
78     # specify this dependency.
79     ldflags = [ rebase_path("$root_out_dir/libclearkeycdm.so", root_build_dir) ]
80     libs = [ "rt" ]
81   }