macOS: Fix build of widevinecdmadapter.plugin (issue #2314)

This commit is contained in:
Marshall Greenblatt 2017-11-30 11:31:03 -05:00
parent 69178d519e
commit 7dcabf547b
5 changed files with 37 additions and 17 deletions

View File

@ -789,6 +789,7 @@ static_library("libcef_static") {
"//third_party/libxml",
"//third_party/WebKit/public:blink",
"//third_party/widevine/cdm:headers",
"//third_party/widevine/cdm:widevinecdmadapter",
"//third_party/icu",
"//third_party/zlib:minizip",
"//tools/v8_context_snapshot:v8_context_snapshot",
@ -805,11 +806,6 @@ static_library("libcef_static") {
"//v8",
]
if (!is_mac) {
# TODO(cef): Enable for Mac once Widevine build errors are resolved.
deps += [ "//third_party/widevine/cdm:widevinecdmadapter" ]
}
if (is_win) {
sources += gypi_paths2.includes_win + [
"libcef/browser/browser_main_win.cc",
@ -1366,8 +1362,7 @@ if (is_mac) {
"$root_out_dir/cef_extensions.pak",
"$root_out_dir/devtools_resources.pak",
"$root_out_dir/v8_context_snapshot.bin",
# TODO(cef): Restore this line once Widevine build errors are resolved.
# "$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin",
"$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin",
]
public_deps = [
@ -1376,8 +1371,7 @@ if (is_mac) {
":pak_200_percent",
":pak_devtools",
":pak_extensions",
# TODO(cef): Restore this line once Widevine build errors are resolved.
# "//third_party/widevine/cdm:widevinecdmadapter",
"//third_party/widevine/cdm:widevinecdmadapter",
"//tools/v8_context_snapshot:v8_context_snapshot",
]

View File

@ -331,4 +331,9 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2274
'name': 'win_rt_2274',
},
{
# macOS: Fix build of widevinecdmadapter.plugin.
# https://bitbucket.org/chromiumembedded/cef/issues/2314
'name': 'mac_widevine_2314',
},
]

View File

@ -0,0 +1,21 @@
diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn
index a3eac59cc2eb..d14e71e0319b 100644
--- third_party/widevine/cdm/BUILD.gn
+++ third_party/widevine/cdm/BUILD.gn
@@ -111,14 +111,8 @@ if (widevine_cdm_binary_files != []) {
]
if (is_mac) {
- ldflags = [
- # Not to strip important symbols by -Wl,-dead_strip.
- "-Wl,-exported_symbol,_PPP_GetInterface",
- "-Wl,-exported_symbol,_PPP_InitializeModule",
- "-Wl,-exported_symbol,_PPP_ShutdownModule",
- ]
- #TODO(jrummell) Mac: 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
- } else if (is_posix && !is_mac) {
+ ldflags = [ "-Wl,-install_name,@loader_path/libwidevinecdm.dylib" ]
+ } else if (is_posix) {
cflags = [ "-fvisibility=hidden" ]
}
}

View File

@ -842,11 +842,11 @@ elif platform == 'macosx':
valid_build_dir = build_dir
dst_dir = os.path.join(output_dir, 'Debug')
make_dir(dst_dir, options.quiet)
framework_dst_dir = os.path.join(dst_dir, '%s.framework' % framework_name)
copy_dir(os.path.join(build_dir, 'cefclient.app/Contents/Frameworks/%s.framework' % framework_name), \
os.path.join(dst_dir, '%s.framework' % framework_name), options.quiet)
copy_file(
os.path.join(script_dir, 'distrib/mac/widevinecdmadapter.plugin'),
dst_dir, options.quiet)
framework_dst_dir, options.quiet)
move_file(os.path.join(framework_dst_dir, 'Resources/widevinecdmadapter.plugin'), \
os.path.join(dst_dir, 'widevinecdmadapter.plugin'), options.quiet)
if not options.nosymbols:
# create the symbol output directory
@ -869,11 +869,11 @@ elif platform == 'macosx':
dst_dir = os.path.join(output_dir, 'Release')
make_dir(dst_dir, options.quiet)
if mode != 'client':
framework_dst_dir = os.path.join(dst_dir, '%s.framework' % framework_name)
copy_dir(os.path.join(build_dir, 'cefclient.app/Contents/Frameworks/%s.framework' % framework_name), \
os.path.join(dst_dir, '%s.framework' % framework_name), options.quiet)
copy_file(
os.path.join(script_dir, 'distrib/mac/widevinecdmadapter.plugin'),
dst_dir, options.quiet)
framework_dst_dir, options.quiet)
move_file(os.path.join(framework_dst_dir, 'Resources/widevinecdmadapter.plugin'), \
os.path.join(dst_dir, 'widevinecdmadapter.plugin'), options.quiet)
else:
copy_dir(
os.path.join(build_dir, 'cefclient.app'),