OLD | NEW |
---|---|
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)) { | |
xhwang
2017/04/04 17:45:10
is_linux includes is_chromeos, so "is_chromeos" is
Haoming Chen
2017/04/04 18:11:45
Done. Also fixed line 100.
| |
28 use_stub_cdm_for_chrome = true | |
29 } | |
30 | |
21 if (is_android) { | 31 if (is_android) { |
22 # Always available on Android regardless of branding. | 32 # Always available on Android regardless of branding. |
23 widevine_cdm_version_h_file = "android/widevine_cdm_version.h" | 33 widevine_cdm_version_h_file = "android/widevine_cdm_version.h" |
24 } else if (is_chrome_branded) { | 34 } else if (is_chrome_branded) { |
25 if (is_chromeos) { | 35 if (is_chromeos) { |
26 widevine_cdm_version_h_file = | 36 widevine_cdm_version_h_file = |
27 "chromeos/$widevine_arch/widevine_cdm_version.h" | 37 "chromeos/$widevine_arch/widevine_cdm_version.h" |
28 widevine_cdm_binary_files = [ "chromeos/$widevine_arch/libwidevinecdm.so" ] | 38 widevine_cdm_binary_files = [ "chromeos/$widevine_arch/libwidevinecdm.so" ] |
29 } else if (is_linux) { | 39 } else if (is_linux) { |
30 widevine_cdm_version_h_file = "linux/$widevine_arch/widevine_cdm_version.h" | 40 widevine_cdm_version_h_file = "linux/$widevine_arch/widevine_cdm_version.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 "widevine_cdm_common.h", | 85 "widevine_cdm_common.h", |
76 ] | 86 ] |
77 | 87 |
78 public_deps = [ | 88 public_deps = [ |
79 ":version_h", # Forward permission to use version header. | 89 ":version_h", # Forward permission to use version header. |
80 "//media:media_features", | 90 "//media:media_features", |
81 "//ppapi/features", | 91 "//ppapi/features", |
82 ] | 92 ] |
83 } | 93 } |
84 | 94 |
85 if (widevine_cdm_binary_files != []) { | 95 if (use_stub_cdm_for_chrome) { |
96 widevine_cdm_binary_files = [] | |
97 copy("copy_widevinecdm") { | |
98 if (is_linux) { | |
99 widevine_cdm = [ "linux/$widevine_arch/libwidevinecdm.so" ] | |
100 } else if (is_chromeos) { | |
101 widevine_cdm = [ "chromeos/$widevine_arch/libwidevinecdm.so" ] | |
102 } | |
103 sources = widevine_cdm | |
104 outputs = [ | |
105 "$root_out_dir/$widevine_cdm_path/{{source_file_part}}", | |
106 ] | |
107 } | |
108 | |
109 shared_library("widevinecdm") { | |
110 output_dir = "$root_out_dir/$widevine_cdm_path/stub_cdm" | |
111 sources = [ | |
112 "//media/cdm/stub/stub_cdm.cc", | |
113 "//media/cdm/stub/stub_cdm.h", | |
114 ] | |
115 | |
116 defines = [ "CDM_IMPLEMENTATION" ] | |
117 | |
118 deps = [ | |
119 ":version_h", | |
120 ":copy_widevinecdm", | |
121 "//base", | |
122 "//build/config/sanitizers:deps", | |
123 ] | |
124 | |
125 public_deps = [ ":copy_widevinecdm" ] | |
126 cflags = [ "-fvisibility=hidden" ] | |
127 } | |
128 } else if (widevine_cdm_binary_files != []) { | |
86 copy("widevinecdm") { | 129 copy("widevinecdm") { |
87 sources = widevine_cdm_binary_files | 130 sources = widevine_cdm_binary_files |
88 outputs = [ | 131 outputs = [ |
89 "$root_out_dir/$widevine_cdm_path/{{source_file_part}}", | 132 "$root_out_dir/$widevine_cdm_path/{{source_file_part}}", |
90 ] | 133 ] |
91 | 134 |
92 # TODO(jrummell) | 135 # TODO(jrummell) |
93 # 'COPY_PHASE_STRIP': 'NO', | 136 # 'COPY_PHASE_STRIP': 'NO', |
94 } | 137 } |
95 } else if (enable_widevine && enable_pepper_cdms) { | 138 } else if (enable_widevine && enable_pepper_cdms) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 deps = [ | 201 deps = [ |
159 ":version_h", | 202 ":version_h", |
160 ":widevinecdm", | 203 ":widevinecdm", |
161 ":widevinecdmadapter_resources", | 204 ":widevinecdmadapter_resources", |
162 ] | 205 ] |
163 data_deps = [ | 206 data_deps = [ |
164 ":widevine_cdm_manifest", | 207 ":widevine_cdm_manifest", |
165 ":widevinecdm", | 208 ":widevinecdm", |
166 ] | 209 ] |
167 | 210 |
168 if (is_linux) { | 211 if (is_linux && !use_stub_cdm_for_chrome) { |
169 ldflags = | 212 ldflags = |
170 [ rebase_path("$root_out_dir/$widevine_cdm_path/libwidevinecdm.so", | 213 [ rebase_path("$root_out_dir/$widevine_cdm_path/libwidevinecdm.so", |
171 root_build_dir) ] | 214 root_build_dir) ] |
172 } else if (is_win) { | 215 } else if (is_win) { |
173 ldflags = | 216 ldflags = |
174 [ rebase_path("$root_out_dir/$widevine_cdm_path/widevinecdm.dll.lib", | 217 [ rebase_path("$root_out_dir/$widevine_cdm_path/widevinecdm.dll.lib", |
175 root_build_dir) ] | 218 root_build_dir) ] |
176 } else if (is_mac) { | 219 } else if (is_mac) { |
177 ldflags = | 220 ldflags = |
178 [ rebase_path("$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib", | 221 [ rebase_path("$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib", |
(...skipping 25 matching lines...) Expand all Loading... | |
204 "../scripts/signer.py", | 247 "../scripts/signer.py", |
205 ] | 248 ] |
206 outputs = [ | 249 outputs = [ |
207 "$root_out_dir/installer/widevine/{{source_file_part}}", | 250 "$root_out_dir/installer/widevine/{{source_file_part}}", |
208 ] | 251 ] |
209 } | 252 } |
210 } else { | 253 } else { |
211 group("widevine_signature_scripts") { | 254 group("widevine_signature_scripts") { |
212 } | 255 } |
213 } | 256 } |
OLD | NEW |