Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: third_party/widevine/cdm/BUILD.gn

Issue 2792743002: Use Stub CDM for building libwidevinecdmadapter.so (Closed)
Patch Set: Use Stub CDM for building widevinecdmadapter. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/chrome_build.gni") 5 import("//build/config/chrome_build.gni")
6 import("//build/config/features.gni") 6 import("//build/config/features.gni")
7 import("//chrome/process_version_rc_template.gni") 7 import("//chrome/process_version_rc_template.gni")
8 import("//media/cdm/ppapi/cdm_paths.gni") 8 import("//media/cdm/ppapi/cdm_paths.gni")
9 import("//media/cdm/ppapi/ppapi_cdm_adapter.gni") 9 import("//media/cdm/ppapi/ppapi_cdm_adapter.gni")
10 import("//ppapi/features/features.gni") 10 import("//ppapi/features/features.gni")
11 import("//third_party/widevine/cdm/widevine.gni") 11 import("//third_party/widevine/cdm/widevine.gni")
12 12
13 widevine_arch = current_cpu 13 widevine_arch = current_cpu
14 if (widevine_arch == "x86") { 14 if (widevine_arch == "x86") {
15 widevine_arch = "ia32" 15 widevine_arch = "ia32"
16 } 16 }
17 17
18 widevine_cdm_binary_files = [] 18 widevine_cdm_binary_files = []
19 widevine_cdm_manifest_file = [] 19 widevine_cdm_manifest_file = []
20 20
21 # Due to crbug.com/707488, in linux and chromeos chrome, we temporarily use
22 # stub cdm for building cdm adapter and copy the real cdm after that.
23 # The stub libwidevinecdm.so is in the sub-directory "./stub_cdm" to avoid
24 # GN's complaint about generating the same output in two targets.
25 # TODO(hmchen): Revert this change after crbug.com/707488 fixed.
26 use_stub_cdm_for_chrome = false
27 if (is_chrome_branded && (is_linux || is_chromeos)) {
28 enable_widevine = true
xhwang 2017/04/04 06:48:52 This will enable VerifyCdmHost on linux and chrome
Haoming Chen 2017/04/04 17:16:15 Done.
29 use_stub_cdm_for_chrome = true
30 }
31
21 if (is_android) { 32 if (is_android) {
22 # Always available on Android regardless of branding. 33 # Always available on Android regardless of branding.
23 widevine_cdm_version_h_file = "android/widevine_cdm_version.h" 34 widevine_cdm_version_h_file = "android/widevine_cdm_version.h"
24 } else if (is_chrome_branded) { 35 } else if (is_chrome_branded) {
25 if (is_chromeos) { 36 if (is_chromeos) {
26 widevine_cdm_version_h_file = 37 widevine_cdm_version_h_file =
27 "chromeos/$widevine_arch/widevine_cdm_version.h" 38 "chromeos/$widevine_arch/widevine_cdm_version.h"
28 widevine_cdm_binary_files = [ "chromeos/$widevine_arch/libwidevinecdm.so" ] 39 widevine_cdm_binary_files = [ "chromeos/$widevine_arch/libwidevinecdm.so" ]
29 } else if (is_linux) { 40 } else if (is_linux) {
30 widevine_cdm_version_h_file = "linux/$widevine_arch/widevine_cdm_version.h" 41 widevine_cdm_version_h_file = "linux/$widevine_arch/widevine_cdm_version.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 "widevine_cdm_common.h", 86 "widevine_cdm_common.h",
76 ] 87 ]
77 88
78 public_deps = [ 89 public_deps = [
79 ":version_h", # Forward permission to use version header. 90 ":version_h", # Forward permission to use version header.
80 "//media:media_features", 91 "//media:media_features",
81 "//ppapi/features", 92 "//ppapi/features",
82 ] 93 ]
83 } 94 }
84 95
85 if (widevine_cdm_binary_files != []) { 96 if (use_stub_cdm_for_chrome) {
97 widevine_cdm_binary_files = []
98 copy("copy_widevinecdm") {
99 if (is_linux) {
100 widevine_cdm = [ "linux/$widevine_arch/libwidevinecdm.so" ]
101 } else if (is_chromeos) {
102 widevine_cdm = [ "chromeos/$widevine_arch/libwidevinecdm.so" ]
103 }
104 sources = widevine_cdm
105 outputs = [
106 "$root_out_dir/$widevine_cdm_path/{{source_file_part}}",
107 ]
108 }
109
110 shared_library("widevinecdm") {
111 output_dir = "$root_out_dir/$widevine_cdm_path/stub_cdm"
112 sources = [
113 "//media/cdm/stub/stub_cdm.cc",
114 "//media/cdm/stub/stub_cdm.h",
115 ]
116
117 defines = [ "CDM_IMPLEMENTATION" ]
118
119 deps = [
120 ":version_h",
121 ":copy_widevinecdm",
122 "//base",
123 "//build/config/sanitizers:deps",
124 ]
125
126 public_deps = [ ":copy_widevinecdm" ]
127 cflags = [ "-fvisibility=hidden" ]
128 }
129 } else if (widevine_cdm_binary_files != []) {
86 copy("widevinecdm") { 130 copy("widevinecdm") {
87 sources = widevine_cdm_binary_files 131 sources = widevine_cdm_binary_files
88 outputs = [ 132 outputs = [
89 "$root_out_dir/$widevine_cdm_path/{{source_file_part}}", 133 "$root_out_dir/$widevine_cdm_path/{{source_file_part}}",
90 ] 134 ]
91 135
92 # TODO(jrummell) 136 # TODO(jrummell)
93 # 'COPY_PHASE_STRIP': 'NO', 137 # 'COPY_PHASE_STRIP': 'NO',
94 } 138 }
95 } else if (enable_widevine && enable_pepper_cdms) { 139 } else if (enable_widevine && enable_pepper_cdms) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 deps = [ 202 deps = [
159 ":version_h", 203 ":version_h",
160 ":widevinecdm", 204 ":widevinecdm",
161 ":widevinecdmadapter_resources", 205 ":widevinecdmadapter_resources",
162 ] 206 ]
163 data_deps = [ 207 data_deps = [
164 ":widevine_cdm_manifest", 208 ":widevine_cdm_manifest",
165 ":widevinecdm", 209 ":widevinecdm",
166 ] 210 ]
167 211
168 if (is_linux) { 212 if (use_stub_cdm_for_chrome && is_linux) {
213 ldflags =
214 [ rebase_path(
215 "$root_out_dir/$widevine_cdm_path/stub_cdm/libwidevinecdm.so",
216 root_build_dir) ]
xhwang 2017/04/04 07:00:10 Actually, this is not necessary since we are depen
Haoming Chen 2017/04/04 17:16:15 Done.
217 } else if (is_linux) {
169 ldflags = 218 ldflags =
170 [ rebase_path("$root_out_dir/$widevine_cdm_path/libwidevinecdm.so", 219 [ rebase_path("$root_out_dir/$widevine_cdm_path/libwidevinecdm.so",
171 root_build_dir) ] 220 root_build_dir) ]
172 } else if (is_win) { 221 } else if (is_win) {
173 ldflags = 222 ldflags =
174 [ rebase_path("$root_out_dir/$widevine_cdm_path/widevinecdm.dll.lib", 223 [ rebase_path("$root_out_dir/$widevine_cdm_path/widevinecdm.dll.lib",
175 root_build_dir) ] 224 root_build_dir) ]
176 } else if (is_mac) { 225 } else if (is_mac) {
177 ldflags = 226 ldflags =
178 [ rebase_path("$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib", 227 [ rebase_path("$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib",
(...skipping 25 matching lines...) Expand all
204 "../scripts/signer.py", 253 "../scripts/signer.py",
205 ] 254 ]
206 outputs = [ 255 outputs = [
207 "$root_out_dir/installer/widevine/{{source_file_part}}", 256 "$root_out_dir/installer/widevine/{{source_file_part}}",
208 ] 257 ]
209 } 258 }
210 } else { 259 } else {
211 group("widevine_signature_scripts") { 260 group("widevine_signature_scripts") {
212 } 261 }
213 } 262 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698