221 lines
6.5 KiB
Python
221 lines
6.5 KiB
Python
# Copyright 2015 Google Inc. All Rights Reserved.
|
|
#
|
|
# Refer to the distribution package's integration guide
|
|
# (Widevine_CE_CDM_IntegrationGuide_v3.2.x.pdf) for information about
|
|
# setting up your system, performing the build, and using/testing
|
|
# the build targets.
|
|
|
|
{
|
|
'variables': {
|
|
# Override if you intend to link against a different OEMCrypto API version.
|
|
'oemcrypto_version%': 13,
|
|
|
|
# Override if you can't depend on OpenSSL for privacy features.
|
|
# If set to 'dummy', privacy mode in the CDM will fail.
|
|
'privacy_crypto_impl%': 'openssl',
|
|
|
|
# There are two openssl configurations:
|
|
#
|
|
# 1) openssl_config == 'system'
|
|
# Use the openssl headers found in the sysroot and link the system library.
|
|
#
|
|
# 2) openssl_config == 'target'
|
|
# Use the openssl implementation in an existing GYP target.
|
|
# Specify the openssl target in openssl_target. This target should forward
|
|
# the include path to its headers to its dependents.
|
|
'openssl_config%': 'system',
|
|
'openssl_target%': '',
|
|
|
|
# There are three protobuf configurations:
|
|
#
|
|
# 1) protobuf_config == 'system'
|
|
# Use a system-wide installation of protobuf.
|
|
# Specify the protobuf library in protobuf_lib.
|
|
# Specify the path to protoc in protoc_bin.
|
|
#
|
|
# 2) protobuf_config == 'target'
|
|
# Use an existing protobuf gyp target from your project.
|
|
# Specify the protobuf gyp file and target in protobuf_lib_target.
|
|
# Specify the protoc gyp file and target in protoc_host_target.
|
|
# Specify the path to protoc in protoc_bin.
|
|
#
|
|
# 3) protobuf_config == 'source' (default)
|
|
# Build protobuf and protoc from source.
|
|
# Specify the path to the protobuf source in protobuf_source.
|
|
'protobuf_config%': 'source',
|
|
'protobuf_source%': '../third_party/protobuf',
|
|
'protoc_host_target%': 'dummy',
|
|
}, # variables
|
|
'includes': ['core.gypi'], # Get list of core source files.
|
|
'conditions': [
|
|
['protobuf_config=="source"', {
|
|
# Include protobuf targets used by protobuf_config=='source'
|
|
'includes': ['../third_party/protobuf.gypi'],
|
|
}],
|
|
], # conditions
|
|
'targets': [
|
|
{
|
|
'target_name': 'license_protocol',
|
|
'type': 'static_library',
|
|
'standalone_static_library': 1,
|
|
'includes': ['../third_party/protoc.gypi'],
|
|
'sources': [
|
|
'../core/src/license_protocol.proto',
|
|
],
|
|
'variables': {
|
|
'proto_in_dir': '../core/src',
|
|
},
|
|
},
|
|
{
|
|
'target_name': 'device_files',
|
|
'type': 'static_library',
|
|
'standalone_static_library': 1,
|
|
'includes': ['../third_party/protoc.gypi'],
|
|
'sources': ['../core/src/device_files.proto',],
|
|
'variables': {
|
|
'proto_in_dir': '../core/src',
|
|
},
|
|
},
|
|
{
|
|
'target_name': 'metrics_proto',
|
|
'type': 'static_library',
|
|
'standalone_static_library': 1,
|
|
'includes': ['../third_party/protoc.gypi'],
|
|
'sources': ['../metrics/src/metrics.proto',],
|
|
'variables': {
|
|
'proto_in_dir': '../metrics/src',
|
|
},
|
|
},
|
|
{
|
|
'target_name': 'widevine_cdm_core',
|
|
'type': 'static_library',
|
|
'standalone_static_library': 1,
|
|
'dependencies': [
|
|
'device_files',
|
|
'license_protocol',
|
|
'metrics_proto',
|
|
],
|
|
'include_dirs': [
|
|
'../core/include',
|
|
'../metrics/include',
|
|
'../oemcrypto/include',
|
|
'../third_party/jsmn',
|
|
],
|
|
'direct_dependent_settings': {
|
|
'include_dirs': [
|
|
'../core/include',
|
|
'../metrics/include',
|
|
'../oemcrypto/include',
|
|
],
|
|
},
|
|
'sources': [
|
|
'<@(wvcdm_sources)',
|
|
'../core/src/oemcrypto_adapter_static.cpp',
|
|
'../core/src/privacy_crypto_<(privacy_crypto_impl).cpp',
|
|
'../third_party/jsmn/jsmn.h',
|
|
'../third_party/jsmn/jsmn.c',
|
|
],
|
|
'conditions': [
|
|
['oemcrypto_version < 10', {
|
|
'sources': [
|
|
# Include APIs introduced in v10.
|
|
'../core/src/oemcrypto_adapter_static_v10.cpp',
|
|
],
|
|
}],
|
|
['oemcrypto_version < 11', {
|
|
'sources': [
|
|
# Include APIs introduced in v11.
|
|
'../core/src/oemcrypto_adapter_static_v11.cpp',
|
|
],
|
|
}],
|
|
['oemcrypto_version < 12', {
|
|
'sources': [
|
|
# Include APIs introduced in v12.
|
|
'../core/src/oemcrypto_adapter_static_v12.cpp',
|
|
],
|
|
}],
|
|
['oemcrypto_version < 13', {
|
|
'sources': [
|
|
# Include APIs introduced in v13.
|
|
'../core/src/oemcrypto_adapter_static_v13.cpp',
|
|
],
|
|
}],
|
|
['privacy_crypto_impl=="openssl"', {
|
|
'conditions': [
|
|
['openssl_config == "target"', {
|
|
'dependencies': [
|
|
'<(openssl_target)',
|
|
],
|
|
}, {
|
|
# openssl_config == "system"
|
|
'link_settings': {
|
|
'libraries': [
|
|
'-lcrypto',
|
|
],
|
|
},
|
|
}],
|
|
], # conditions
|
|
}], # privacy_crypto_impl=="openssl"
|
|
], # conditions
|
|
}, # widevine_cdm_core target
|
|
{
|
|
'target_name': 'widevine_ce_cdm_static',
|
|
'type': 'static_library',
|
|
'standalone_static_library': 1,
|
|
'dependencies': [
|
|
'widevine_cdm_core',
|
|
'device_files',
|
|
'license_protocol',
|
|
'metrics_proto',
|
|
],
|
|
# Without this, library deps do not propagate from the protocol targets
|
|
# up to the shared lib or executable above.
|
|
'export_dependent_settings': [
|
|
'device_files',
|
|
'license_protocol',
|
|
'metrics_proto',
|
|
],
|
|
'defines': ['CDM_IMPLEMENTATION'],
|
|
'include_dirs': [
|
|
'include',
|
|
],
|
|
'direct_dependent_settings': {
|
|
'include_dirs': [
|
|
'include',
|
|
],
|
|
},
|
|
'link_settings': {
|
|
'libraries': [
|
|
'-lpthread',
|
|
],
|
|
},
|
|
'sources': [
|
|
'include/cdm.h',
|
|
'include/cdm_version.h',
|
|
'include/override.h',
|
|
'include/properties_ce.h',
|
|
'src/cdm.cpp',
|
|
'src/lock.cpp',
|
|
'src/log.cpp',
|
|
'src/properties_ce.cpp',
|
|
],
|
|
}, # widevine_cdm_static target
|
|
{
|
|
'target_name': 'widevine_ce_cdm_shared',
|
|
'type': 'shared_library',
|
|
'dependencies': [
|
|
'widevine_ce_cdm_static',
|
|
],
|
|
'direct_dependent_settings': {
|
|
'include_dirs': [
|
|
'include',
|
|
],
|
|
},
|
|
},
|
|
{
|
|
'target_name': 'dummy',
|
|
'type': 'none',
|
|
},
|
|
],
|
|
}
|