Files
ce_cdm/cdm/cdm_unittests.gyp
2019-06-28 16:02:52 -07:00

135 lines
4.7 KiB
Python

# Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
#source code may only be used and distributed under the Widevine Master License
#Agreement.
#
# Builds under the CDM ./build.py (target platform) build system
# Refer to the distribution package's README for details.
{
'variables': {
# Label as 'static' or 'dynamic' to use the respective OEMCrypto adapter.
'oemcrypto_adapter%': 'static',
# Choose type of OEMCrypto library to compile in. Valid values are:
#
# 'vendor' - Production Level 1 systems should use 'vendor' to indicate that
# they are providing their own OEMCrypto library and the Widevine
# CE CDM build system is not responsible for building anything.
#
# 'ref' - The default value of 'ref' builds the OEMCrypto reference code, in
# order to allow the CE CDM to build without a vendor integration.
# This setting should *NEVER* be used in production systems and is
# for testing purposes only.
#
# 'level3' - Partners who have received a Widevine-generated Level 3 library
# should use 'level3' to indicate that the Widevine CE CDM build
# system should include it in the build.
#
# 'target' - If your vendor OEMCrypto is built using GYP and you would like
# the Widevine CE CDM build system to build it as part of the CE
# CDM build process, you can use 'target' and also set the
# variable 'oemcrypto_gyp_target' below. Most vendors will want
# to use 'vendor', above, instead. This setting exists primarily
# for Google's internal testing.
'oemcrypto_lib%': 'ref',
# You only need to set this value if you set 'oemcrypto_lib' to 'target'
# above.
'oemcrypto_gyp_target%': '',
# Override this for the location to the BoringSSL gyp file.
'boringssl_dependency%': '../third_party/boringssl/boringssl.gyp:ssl',
# Directory where OEMCrypto header, test, and reference files lives.
'oemcrypto_dir%': '../oemcrypto',
# Directory where widevine utilities live.
'util_dir%': '../util',
'metrics_target%': 'cdm.gyp:metrics_proto',
'device_files_target%': 'cdm.gyp:device_files',
},
'targets': [
{
'target_name': 'widevine_ce_cdm_unittest',
'type': 'executable',
'sources': [
# The test runner and the testing device certificate.
'test/cdm_test_main.cpp',
'test/device_cert.cpp',
'test/device_cert.h',
# The test host, which is required for all test suites on CE.
'test/test_host.cpp',
'test/test_host.h',
],
'includes': [
'../oemcrypto/test/oemcrypto_unittests.gypi',
'core_unittests.gypi',
'cdm_unittests.gypi',
],
'dependencies': [
'cdm.gyp:widevine_ce_cdm_static',
'../third_party/gmock.gyp:gmock',
'../third_party/gmock.gyp:gtest',
],
'defines': [
# The methods in util/ are marked as dllimport but in this case are
# being loaded in the static library. So define this so Windows
# doesn't look in a DLL for the implementations.
'CORE_UTIL_IMPLEMENTATION',
],
'msvs_settings': {
'VCLinkerTool': {
# Additionally, since they are loaded locally, suppress these
# warnings.
'AdditionalOptions': [
'/IGNORE:4049',
'/IGNORE:4217',
],
},
},
'conditions': [
['oemcrypto_lib=="ref"', {
'dependencies': [
'oec_ref_shared',
],
}],
['oemcrypto_lib=="level3"', {
'sources': [
# The test impl of OEMCrypto_Level3FileSystem and its factory.
'test/level3_file_system_ce_test.h',
'test/level3_file_system_ce_test.cpp',
'test/level3_file_system_ce_test_factory.cpp',
],
'conditions': [
['oemcrypto_adapter=="static"', {
'dependencies': [
'../oemcrypto/level3/oec_level3.gyp:oec_level3_static',
],
}, {
'dependencies': [
'../oemcrypto/level3/oec_level3.gyp:oec_level3_dynamic',
],
}],
],
}],
['oemcrypto_lib=="target"', {
'dependencies': [
'<(oemcrypto_gyp_target)',
],
}],
],
},
{
'target_name': 'oec_ref',
'type': 'static_library',
'standalone_static_library': 1,
'hard_dependency': 1,
'includes': [
'../oemcrypto/ref/oec_ref.gypi',
],
},
{
'target_name': 'oec_ref_shared',
'type': 'shared_library',
'dependencies': [
'oec_ref'
],
},
],
}