summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-02-25 10:46:53 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-25 18:48:11 +0000
commit70d2f6ea98ae618b24a7c517570b74d20b92a7c7 (patch)
treed9710e84119b831e80d1e41e9513a5d8c2f7dfb1 /media
parent830ccc4c45969c05684bb8e6919197706859d0ec (diff)
downloadchromium_src-70d2f6ea98ae618b24a7c517570b74d20b92a7c7.zip
chromium_src-70d2f6ea98ae618b24a7c517570b74d20b92a7c7.tar.gz
chromium_src-70d2f6ea98ae618b24a7c517570b74d20b92a7c7.tar.bz2
Fix official build in GN
Changes process_version template. In GYP this is used in two ways and the GN version only supported one of these. This change also deletes an unnecessary fork of the template file, and fixes the dependencies for the extra files (previously they were just passed with "-f" and not added to the inputs of the target. Adds a cdm_adapter template which basically matches the GYP version. Uses this for the media clearkey adapter and the widevine one in the official build. Fixes for the crypto targets when compiling with the official build's checked-in sysroots. Review URL: https://codereview.chromium.org/949233003 Cr-Commit-Position: refs/heads/master@{#318083}
Diffstat (limited to 'media')
-rw-r--r--media/cdm/ppapi/BUILD.gn32
-rw-r--r--media/cdm/ppapi/cdm_adapter.gni129
-rw-r--r--media/media_cdm.gypi1
-rw-r--r--media/media_cdm_adapter.gyp4
4 files changed, 159 insertions, 7 deletions
diff --git a/media/cdm/ppapi/BUILD.gn b/media/cdm/ppapi/BUILD.gn
index 9a85bd3..5bcca69 100644
--- a/media/cdm/ppapi/BUILD.gn
+++ b/media/cdm/ppapi/BUILD.gn
@@ -3,6 +3,8 @@
# found in the LICENSE file.
import("//build/config/features.gni")
+import("//chrome/version.gni") # TODO layering violation!
+import("//media/cdm/ppapi/cdm_adapter.gni")
# Android doesn't use ffmpeg.
use_ffmpeg = !is_android
@@ -47,14 +49,34 @@ shared_library("clearkeycdm") {
# TODO(GYP) on Mac: 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
}
-# TODO(GYP): clearkeycdmadapter_resources
+clearkeycdmadapter_rc_file = "$target_gen_dir/clearkeycdmadapter_version.rc"
-group("clearkeycdmadapter") {
+process_version("clearkeycdmadapter_resources") {
+ visibility = [ ":*" ]
+ sources = [
+ "external_clear_key/BRANDING",
+ "//media/clearkeycdmadapter.ver",
+ ]
+ output = clearkeycdmadapter_rc_file
+}
+
+cdm_adapter("clearkeycdmadapter") {
+ sources = [
+ clearkeycdmadapter_rc_file,
+ ]
+
+ # Check whether the plugin's origin URL is valid.
+ defines = [ "CHECK_DOCUMENT_URL" ]
deps = [
- #":cdmadapter", TODO(GYP)
":clearkeycdm",
-
- #":clearkeycdmadapter_resources", TODO(GYP)
+ ":clearkeycdmadapter_resources",
"//ppapi/cpp",
]
+
+ if (is_posix && !is_mac && enable_pepper_cdms) {
+ # Because clearkeycdm has type 'loadable_module', we must explicitly
+ # specify this dependency.
+ ldflags = [ rebase_path("$root_out_dir/libclearkeycdm.so", root_build_dir) ]
+ libs = [ "rt" ]
+ }
}
diff --git a/media/cdm/ppapi/cdm_adapter.gni b/media/cdm/ppapi/cdm_adapter.gni
new file mode 100644
index 0000000..cee8ce6
--- /dev/null
+++ b/media/cdm/ppapi/cdm_adapter.gni
@@ -0,0 +1,129 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This template defines a CDM adapter target. Just use this as you would a
+# normal target and everything should work correctly. If GYP, you would instead
+# depend on media/media_cdm_adapter.gyp:cdmadapter which would in turn modify
+# your target with direct_dependent_settings.
+template("cdm_adapter") {
+ # TODO(GYP) On Mac/Linux this should be a loadable_module.
+ shared_library(target_name) {
+ # Don't filter sources list again.
+ set_sources_assignment_filter([])
+
+ sources = [
+ "//media/cdm/ppapi/api/content_decryption_module.h",
+ "//media/cdm/ppapi/cdm_adapter.cc",
+ "//media/cdm/ppapi/cdm_adapter.h",
+ "//media/cdm/ppapi/cdm_file_io_impl.cc",
+ "//media/cdm/ppapi/cdm_file_io_impl.h",
+ "//media/cdm/ppapi/cdm_helpers.cc",
+ "//media/cdm/ppapi/cdm_helpers.h",
+ "//media/cdm/ppapi/cdm_logging.cc",
+ "//media/cdm/ppapi/cdm_logging.h",
+ "//media/cdm/ppapi/cdm_wrapper.h",
+ "//media/cdm/ppapi/linked_ptr.h",
+ "//media/cdm/ppapi/supported_cdm_versions.h",
+ ]
+ if (defined(invoker.sources)) {
+ sources += invoker.sources
+ }
+
+ 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(GYP) Mac: 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
+ } else if (is_posix && !is_mac) {
+ cflags = [ "-fvisibility=hidden" ]
+ # Note GYP sets rpath but this is set by default on shared libraries in
+ # the GN build.
+ }
+
+ # TODO(jschuh) crbug.com/167187
+ configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
+
+ if (defined(invoker.all_dependent_configs)) {
+ all_dependent_configs = invoker.all_dependent_configs
+ }
+ if (defined(invoker.allow_circular_includes_from)) {
+ allow_circular_includes_from = invoker.allow_circular_includes_from
+ }
+ if (defined(invoker.cflags)) {
+ cflags = invoker.cflags
+ }
+ if (defined(invoker.cflags_c)) {
+ cflags_c = invoker.cflags_c
+ }
+ if (defined(invoker.cflags_cc)) {
+ cflags_cc = invoker.cflags_cc
+ }
+ if (defined(invoker.cflags_objc)) {
+ cflags_objc = invoker.cflags_objc
+ }
+ if (defined(invoker.cflags_objcc)) {
+ cflags_objcc = invoker.cflags_objcc
+ }
+ if (defined(invoker.check_includes)) {
+ check_includes = invoker.check_includes
+ }
+ if (defined(invoker.data)) {
+ data = invoker.data
+ }
+ if (defined(invoker.data_deps)) {
+ data_deps = invoker.data_deps
+ }
+ if (defined(invoker.datadeps)) {
+ datadeps = invoker.datadeps
+ }
+ if (defined(invoker.defines)) {
+ defines = invoker.defines
+ }
+ if (defined(invoker.deps)) {
+ deps = invoker.deps
+ }
+ if (defined(invoker.direct_dependent_configs)) {
+ direct_dependent_configs = invoker.direct_dependent_configs
+ }
+ if (defined(invoker.forward_dependent_configs_from)) {
+ forward_dependent_configs_from = invoker.forward_dependent_configs_from
+ }
+ if (defined(invoker.include_dirs)) {
+ include_dirs = invoker.include_dirs
+ }
+ if (defined(invoker.ldflags)) {
+ ldflags = invoker.ldflags
+ }
+ if (defined(invoker.lib_dirs)) {
+ lib_dirs = invoker.lib_dirs
+ }
+ if (defined(invoker.libs)) {
+ libs = invoker.libs
+ }
+ if (defined(invoker.output_extension)) {
+ output_extension = invoker.output_extension
+ }
+ if (defined(invoker.output_name)) {
+ output_name = invoker.output_name
+ }
+ if (defined(invoker.public)) {
+ public = invoker.public
+ }
+ if (defined(invoker.public_configs)) {
+ public_configs = invoker.public_configs
+ }
+ if (defined(invoker.public_deps)) {
+ public_deps = invoker.public_deps
+ }
+ if (defined(invoker.testonly)) {
+ testonly = invoker.testonly
+ }
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
+ }
+ }
+}
diff --git a/media/media_cdm.gypi b/media/media_cdm.gypi
index 85c8276..7d92732 100644
--- a/media/media_cdm.gypi
+++ b/media/media_cdm.gypi
@@ -98,6 +98,7 @@
'msvs_disabled_warnings': [ 4267, ],
},
{
+ # GN version: //media/cdm/ppapi:clearkeycdmadapter_resources
'target_name': 'clearkeycdmadapter_resources',
'type': 'none',
'conditions': [
diff --git a/media/media_cdm_adapter.gyp b/media/media_cdm_adapter.gyp
index bb21c96..d833819 100644
--- a/media/media_cdm_adapter.gyp
+++ b/media/media_cdm_adapter.gyp
@@ -16,8 +16,8 @@
['enable_pepper_cdms==1', {
'targets': [
{
- # For GN, we may want a template that defines a target of the right
- # type with the right dependencies.
+ # GN version: Use the template cdm_adapter in
+ # //media/cdm/ppapi/cdm_adapter.gni.
'target_name': 'cdmadapter',
'type': 'none',
'direct_dependent_settings': {