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 widevine_arch = current_cpu
10 if (widevine_arch == "x86") {
11 widevine_arch = "ia32"
15 # Always available on Android regardless of branding.
16 widevine_cdm_version_h_file = "android/widevine_cdm_version.h"
17 widevine_cdm_binary_files = []
18 } else if (is_chrome_branded) {
20 widevine_cdm_version_h_file =
21 "chromeos/$widevine_arch/widevine_cdm_version.h"
22 widevine_cdm_binary_files = [ "chromeos/$widevine_arch/libwidevinecdm.so" ]
23 } else if (is_linux) {
24 widevine_cdm_version_h_file = "linux/$widevine_arch/widevine_cdm_version.h"
25 widevine_cdm_binary_files = [ "linux/$widevine_arch/libwidevinecdm.so" ]
27 widevine_cdm_version_h_file = "win/$widevine_arch/widevine_cdm_version.h"
28 widevine_cdm_binary_files = [
29 "win/$widevine_arch/widevinecdm.dll",
30 "win/$widevine_arch/widevinecdm.dll.lib",
33 widevine_cdm_version_h_file = "mac/$widevine_arch/widevine_cdm_version.h"
34 widevine_cdm_binary_files = [ "mac/$widevine_arch/libwidevinecdm.dylib" ]
36 # Other platforms, use the default one.
37 widevine_cdm_version_h_file = "widevine_cdm_version.h"
38 widevine_cdm_binary_files = []
41 # No branding, use the default one.
42 widevine_cdm_version_h_file = "widevine_cdm_version.h"
43 widevine_cdm_binary_files = []
46 # GYP version: third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h
49 widevine_cdm_version_h_file,
52 # TODO(brettw) this should go into target_out_dir and callers should include
53 # it from there. This requires, however, renaming the default
54 # widevine_cdm_version.h in this directory to avoid conflicts.
56 "$root_gen_dir/widevine_cdm_version.h",
60 # GYP version: third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_binaries
61 if (widevine_cdm_binary_files == []) {
67 sources = widevine_cdm_binary_files
69 "$root_out_dir/{{source_file_part}}",
73 # 'COPY_PHASE_STRIP': 'NO',
77 if (is_chrome_branded && enable_pepper_cdms) {
78 adapter_resource_file = "$target_gen_dir/widevinecdmadapter_version.rc"
80 # Produce the .rc file.
81 process_version("adapter_resources") {
85 "widevinecdmadapter.ver",
87 output = adapter_resource_file
90 cdm_adapter("adapter") {
92 adapter_resource_file,
103 [ rebase_path("$root_out_dir/libwidevinecdm.so", root_build_dir) ]
107 [ rebase_path("$root_out_dir/widevinecdm.dll.lib", root_build_dir) ]
110 [ rebase_path("$root_out_dir/libwidevinecdm.dylib", root_build_dir) ]
114 # Placeholder when we're not compiling the adapter.
119 # This target exists for tests to depend on that pulls in a runtime dependency
120 # on the license server.
121 source_set("widevine_test_license_server") {
122 if (is_chrome_branded && is_linux) {
125 # This target should be removed and targets should have datadeps on this target:
126 #"//third_party/widevine/test/license_server/license_server.gyp:test_license_server"