Commit 117144d7 authored by wdzierzanowski's avatar wdzierzanowski Committed by Commit bot

Reland of "Fix build of Widevine CDM stub on Mac"

The combination of 'branding=Chromium' and 'enable_widevine=1' causes
'widevinecdm' to be a 'shared_library' build of the CDM stub.
Additionally combined with 'mac_strip_release=1', this triggers
'strip_save_dsym', which fails, because it doesn't support
'product_dir'.

This fix does to 'widevinecdm' what has already been done to
'clearkeycdm': Split the target into 'widevinecdm_binary' which builds
and strips the stub binary, and 'widevinecdm' which just copies the
binary.

This CL relands https://codereview.chromium.org/2117343005/ with the
following change:

The new 'widevinecdm_binary' target is now defined conditionally for the
case when it is really needed, to fix the ninja error "multiple rules
generate WidevineCdm/_platform_specific/win_x86/widevinecdm.dll".

BUG=622282

TEST='build/gyp_chromium -Gconfig=Release -Dbranding=Chromium -Denable_widevine=1 -Dmac_strip_release=1 && ninja -C out/Release widevinecdm' is successful

Review-Url: https://codereview.chromium.org/2149233003
Cr-Commit-Position: refs/heads/master@{#405635}
parent a771ea85
......@@ -197,13 +197,46 @@
}],
}],
[ 'branding != "Chrome" and enable_widevine == 1', {
'product_dir': '<(PRODUCT_DIR)/<(widevine_cdm_path)',
# On Mac this copies the widevinecdm binary to <(widevine_cdm_path).
# On other platforms the binary is already in <(widevine_cdm_path).
# See "widevinecdm_binary".
'dependencies': [
'widevinecdm_binary',
],
'conditions': [
['OS == "mac"', {
'copies': [{
'destination': '<(PRODUCT_DIR)/<(widevine_cdm_path)',
'files': [ '<(PRODUCT_DIR)/libwidevinecdm.dylib' ],
}],
}],
],
}],
],
},
{
# GN version: //third_party/widevine/cdm:widevine_test_license_server
'target_name': 'widevine_test_license_server',
'type': 'none',
'conditions': [
[ 'branding == "Chrome" and OS == "linux"', {
'dependencies': [
'<(DEPTH)/third_party/widevine/test/license_server/license_server.gyp:test_license_server',
],
}],
],
},
],
'conditions': [
[ 'branding != "Chrome" and enable_widevine == 1', {
'targets': [
{
'target_name': 'widevinecdm_binary',
'product_name': 'widevinecdm',
'type': 'none',
'conditions': [
['os_posix == 1 and OS != "mac"', {
'type': 'loadable_module',
# This causes the binary to be put in
# <(PRODUCT_DIR)/<(widevine_cdm_path) instead of lib/.
# This matches what happens in the copy step above.
}],
['OS == "mac" or OS == "win"', {
'type': 'shared_library',
......@@ -212,6 +245,12 @@
'xcode_settings': {
'DYLIB_INSTALL_NAME_BASE': '@loader_path',
},
}, {
# Put Widevine CDM in the correct path directly except
# for mac. On mac strip_save_dsym doesn't work with product_dir
# so we rely on the "widevinecdm" target to copy it over.
# See http://crbug.com/611990
'product_dir': '<(PRODUCT_DIR)/<(widevine_cdm_path)',
}],
],
'defines': ['CDM_IMPLEMENTATION'],
......@@ -223,20 +262,8 @@
'<(DEPTH)/media/cdm/stub/stub_cdm.cc',
'<(DEPTH)/media/cdm/stub/stub_cdm.h',
],
}],
],
},
{
# GN version: //third_party/widevine/cdm:widevine_test_license_server
'target_name': 'widevine_test_license_server',
'type': 'none',
'conditions': [
[ 'branding == "Chrome" and OS == "linux"', {
'dependencies': [
'<(DEPTH)/third_party/widevine/test/license_server/license_server.gyp:test_license_server',
],
}],
},
],
},
}],
],
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment