Chromium Code Reviews| Index: chrome/BUILD.gn |
| diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn |
| index 1c26c3f29012af6f22a4709c98c11ea97376a6b7..6c902592c80f59f013ffcfccd10ea05364e715e5 100644 |
| --- a/chrome/BUILD.gn |
| +++ b/chrome/BUILD.gn |
| @@ -14,6 +14,7 @@ import("//build/config/win/manifest.gni") |
| import("//chrome/chrome_repack_locales.gni") |
| import("//chrome/common/features.gni") |
| import("//chrome/version.gni") |
| +import("//third_party/widevine/cdm/widevine.gni") |
| import("//ui/base/ui_features.gni") |
| if (is_android) { |
| @@ -795,21 +796,47 @@ if (is_win) { |
| "//third_party/adobe/flash:flapper_binaries", |
| ] |
| } |
| + } else { |
| + group("flash_player_plugin") { |
| + } |
| + } |
| + _should_bundle_widevine = |
| + (is_chrome_branded || enable_widevine) && enable_pepper_cdms |
| + if (_should_bundle_widevine) { |
| + # The Widevine CDM and manifest are either the actual Widevine CDM and |
| + # manifest or stubs used for testing only. The choice is made within the |
| + # corresponding Widevine targets based on branding. |
| bundle_data("widevine_cdm_library_binaries") { |
| sources = [ |
| - "$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib", |
| + "$root_out_dir/libwidevinecdm.dylib", |
| "$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin", |
| ] |
| outputs = [ |
| "{{bundle_root_dir}}/Libraries/$widevine_cdm_path/{{source_file_part}}", |
| ] |
| public_deps = [ |
| - "//third_party/widevine/cdm:widevinecdm", |
| + # Need this intermediate dependency because "widevinecdm" is a |
| + # shared_library if !is_chrome_branded, and then depending on |
| + # "widevinecdm" directly would cause it to be linked into the Chromium |
| + # Framework, which we don't want. |
| + ":widevine_cdm_library_copy", |
|
xhwang
2016/08/25 00:05:45
Can this be a data_deps?
https://chromium.googles
wdzierzanowski
2016/08/25 14:32:02
Tried it. Unfortunately, GN now doesn't generate t
|
| "//third_party/widevine/cdm:widevinecdmadapter", |
| ] |
| } |
| + copy("widevine_cdm_library_copy") { |
| + sources = [ |
| + "$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib", |
| + ] |
| + outputs = [ |
| + "$root_out_dir/{{source_file_part}}", |
| + ] |
| + deps = [ |
| + "//third_party/widevine/cdm:widevinecdm", |
| + ] |
| + } |
| + |
| bundle_data("widevine_cdm_library_manifest") { |
| sources = [ |
| "$root_out_dir/WidevineCdm/manifest.json", |
| @@ -821,13 +848,10 @@ if (is_win) { |
| "//third_party/widevine/cdm:widevine_cdm_manifest", |
| ] |
| } |
| - } else { |
| - group("flash_player_plugin") { |
| - } |
| } |
| group("widevine_cdm_library") { |
| - if (is_chrome_branded) { |
| + if (_should_bundle_widevine) { |
| deps = [ |
| ":widevine_cdm_library_binaries", |
| ":widevine_cdm_library_manifest", |