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

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: change todos 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..10a61b97623e047043c9cbdf164a513f4e9ee5b4 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,28 +61,58 @@ 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 != []) {
+ copy("widevinecdm") {
sources = widevine_cdm_binary_files
outputs = [
"$root_out_dir/{{source_file_part}}",
]
- # TODO(GYP)
+ # TODO(jrummell)
# 'COPY_PHASE_STRIP': 'NO',
}
+} else if (enable_widevine && enable_pepper_cdms) {
+ assert(!is_chrome_branded, "Branded Chrome should have binary files to copy.")
+ assert(!is_android, "Android should not have enable_pepper_cdms.")
+ 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(jrummell) 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 +121,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 +146,7 @@ if (is_chrome_branded && enable_pepper_cdms) {
}
} else {
# Placeholder when we're not compiling the adapter.
- group("adapter") {
+ group("widevinecdmadapter") {
}
}
@@ -121,7 +155,7 @@ if (is_chrome_branded && enable_pepper_cdms) {
source_set("widevine_test_license_server") {
if (is_chrome_branded && is_linux) {
deps = [
- # TODO(GYP)
+ # TODO(jrummell)
# This target should be removed and targets should have datadeps on this target:
#"//third_party/widevine/test/license_server/license_server.gyp:test_license_server"
]
« 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