Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: third_party/widevine/cdm/BUILD.gn

Issue 1070253002: Allow widevinecdmadapter to be built in Chromium with GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build right thing Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/BUILD.gn ('k') | third_party/widevine/cdm/widevine.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/widevine/cdm/BUILD.gn
diff --git a/third_party/widevine/cdm/BUILD.gn b/third_party/widevine/cdm/BUILD.gn
index 3fce784ad36a59bdcca36b6239cac6b1cb12110a..8ebea0ab0d73fa435c5bd967f60296688810f461 100644
--- a/third_party/widevine/cdm/BUILD.gn
+++ b/third_party/widevine/cdm/BUILD.gn
@@ -5,6 +5,7 @@
import("//build/config/features.gni")
import("//chrome/version.gni") # TODO layering violation
import("//media/cdm/ppapi/cdm_adapter.gni")
+import("//third_party/widevine/cdm/widevine.gni")
widevine_arch = current_cpu
if (widevine_arch == "x86") {
@@ -37,6 +38,9 @@ if (is_android) {
widevine_cdm_version_h_file = "widevine_cdm_version.h"
widevine_cdm_binary_files = []
}
+} else if (enable_widevine) {
+ widevine_cdm_version_h_file = "stub/widevine_cdm_version.h"
+ widevine_cdm_binary_files = []
} else {
# No branding, use the default one.
widevine_cdm_version_h_file = "widevine_cdm_version.h"
@@ -57,13 +61,9 @@ copy("version_h") {
]
}
-# GYP version: third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_binaries
-if (widevine_cdm_binary_files == []) {
- group("binaries") {
- # NOP
- }
-} else {
- copy("binaries") {
+# GYP version: third_party/widevine/cdm/widevine_cdm.gyp:widevinecdm
+if (widevine_cdm_binary_files != []) {
DaleCurtis 2015/04/13 18:35:58 is the != [] necessary, does !widevine_cdm_binary_
jrummell 2015/04/13 22:22:35 Doesn't work. Error is "Operand of ! operator is n
+ copy("widevinecdm") {
sources = widevine_cdm_binary_files
outputs = [
"$root_out_dir/{{source_file_part}}",
@@ -72,13 +72,46 @@ if (widevine_cdm_binary_files == []) {
# TODO(GYP)
xhwang 2015/04/14 21:27:30 Here and below, put a real name after TODO.
jrummell 2015/04/14 22:47:43 Done.
# 'COPY_PHASE_STRIP': 'NO',
}
+} else if (!is_android && !is_chrome_branded && enable_widevine) {
xhwang 2015/04/14 21:27:30 Can we do something like? else if (!is_android &&
xhwang 2015/04/14 21:27:30 Here !is_android is pretty much the same as enable
jrummell 2015/04/14 22:47:43 Done.
jrummell 2015/04/14 22:47:43 Done.
+ # TODO(GYP) On Mac/Linux this should be a loadable_module.
jrummell 2015/04/14 22:47:43 Removed this TODO since it came from cdm_adapter t
+ shared_library("widevinecdm") {
+ sources = [
+ "//media/cdm/stub/stub_cdm.cc",
+ "//media/cdm/stub/stub_cdm.h",
+ ]
+
+ defines = [ "CDM_IMPLEMENTATION" ]
+
+ deps = [
+ ":version_h",
+ "//base",
+ ]
+
+ 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.
+ }
+ }
+} else {
+ group("widevinecdm") {
+ # NOP
+ }
}
-if (is_chrome_branded && enable_pepper_cdms) {
+if ((is_chrome_branded || enable_widevine) && enable_pepper_cdms) {
adapter_resource_file = "$target_gen_dir/widevinecdmadapter_version.rc"
# Produce the .rc file.
- process_version("adapter_resources") {
+ process_version("widevinecdmadapter_resources") {
visibility = [ ":*" ]
sources = [
"BRANDING",
@@ -87,13 +120,13 @@ if (is_chrome_branded && enable_pepper_cdms) {
output = adapter_resource_file
}
- cdm_adapter("adapter") {
+ cdm_adapter("widevinecdmadapter") {
sources = [
adapter_resource_file,
]
deps = [
- ":adapter_resources",
- ":binaries",
+ ":widevinecdmadapter_resources",
+ ":widevinecdm",
":version_h",
"//ppapi/cpp",
]
@@ -112,7 +145,7 @@ if (is_chrome_branded && enable_pepper_cdms) {
}
} else {
# Placeholder when we're not compiling the adapter.
- group("adapter") {
+ group("widevinecdmadapter") {
}
}
« no previous file with comments | « chrome/test/BUILD.gn ('k') | third_party/widevine/cdm/widevine.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698