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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « chrome/test/BUILD.gn ('k') | third_party/widevine/cdm/widevine.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/features.gni") 5 import("//build/config/features.gni")
6 import("//chrome/version.gni") # TODO layering violation 6 import("//chrome/version.gni") # TODO layering violation
7 import("//media/cdm/ppapi/cdm_adapter.gni") 7 import("//media/cdm/ppapi/cdm_adapter.gni")
8 import("//third_party/widevine/cdm/widevine.gni")
8 9
9 widevine_arch = current_cpu 10 widevine_arch = current_cpu
10 if (widevine_arch == "x86") { 11 if (widevine_arch == "x86") {
11 widevine_arch = "ia32" 12 widevine_arch = "ia32"
12 } 13 }
13 14
14 if (is_android) { 15 if (is_android) {
15 # Always available on Android regardless of branding. 16 # Always available on Android regardless of branding.
16 widevine_cdm_version_h_file = "android/widevine_cdm_version.h" 17 widevine_cdm_version_h_file = "android/widevine_cdm_version.h"
17 widevine_cdm_binary_files = [] 18 widevine_cdm_binary_files = []
(...skipping 12 matching lines...) Expand all
30 "win/$widevine_arch/widevinecdm.dll.lib", 31 "win/$widevine_arch/widevinecdm.dll.lib",
31 ] 32 ]
32 } else if (is_mac) { 33 } else if (is_mac) {
33 widevine_cdm_version_h_file = "mac/$widevine_arch/widevine_cdm_version.h" 34 widevine_cdm_version_h_file = "mac/$widevine_arch/widevine_cdm_version.h"
34 widevine_cdm_binary_files = [ "mac/$widevine_arch/libwidevinecdm.dylib" ] 35 widevine_cdm_binary_files = [ "mac/$widevine_arch/libwidevinecdm.dylib" ]
35 } else { 36 } else {
36 # Other platforms, use the default one. 37 # Other platforms, use the default one.
37 widevine_cdm_version_h_file = "widevine_cdm_version.h" 38 widevine_cdm_version_h_file = "widevine_cdm_version.h"
38 widevine_cdm_binary_files = [] 39 widevine_cdm_binary_files = []
39 } 40 }
41 } else if (enable_widevine) {
42 widevine_cdm_version_h_file = "stub/widevine_cdm_version.h"
43 widevine_cdm_binary_files = []
40 } else { 44 } else {
41 # No branding, use the default one. 45 # No branding, use the default one.
42 widevine_cdm_version_h_file = "widevine_cdm_version.h" 46 widevine_cdm_version_h_file = "widevine_cdm_version.h"
43 widevine_cdm_binary_files = [] 47 widevine_cdm_binary_files = []
44 } 48 }
45 49
46 # GYP version: third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h 50 # GYP version: third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h
47 copy("version_h") { 51 copy("version_h") {
48 sources = [ 52 sources = [
49 widevine_cdm_version_h_file, 53 widevine_cdm_version_h_file,
50 ] 54 ]
51 55
52 # TODO(brettw) this should go into target_out_dir and callers should include 56 # TODO(brettw) this should go into target_out_dir and callers should include
53 # it from there. This requires, however, renaming the default 57 # it from there. This requires, however, renaming the default
54 # widevine_cdm_version.h in this directory to avoid conflicts. 58 # widevine_cdm_version.h in this directory to avoid conflicts.
55 outputs = [ 59 outputs = [
56 "$root_gen_dir/widevine_cdm_version.h", 60 "$root_gen_dir/widevine_cdm_version.h",
57 ] 61 ]
58 } 62 }
59 63
60 # GYP version: third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_binaries 64 # GYP version: third_party/widevine/cdm/widevine_cdm.gyp:widevinecdm
61 if (widevine_cdm_binary_files == []) { 65 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
62 group("binaries") { 66 copy("widevinecdm") {
63 # NOP
64 }
65 } else {
66 copy("binaries") {
67 sources = widevine_cdm_binary_files 67 sources = widevine_cdm_binary_files
68 outputs = [ 68 outputs = [
69 "$root_out_dir/{{source_file_part}}", 69 "$root_out_dir/{{source_file_part}}",
70 ] 70 ]
71 71
72 # TODO(GYP) 72 # 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.
73 # 'COPY_PHASE_STRIP': 'NO', 73 # 'COPY_PHASE_STRIP': 'NO',
74 } 74 }
75 } 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.
76 # 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
77 shared_library("widevinecdm") {
78 sources = [
79 "//media/cdm/stub/stub_cdm.cc",
80 "//media/cdm/stub/stub_cdm.h",
81 ]
82
83 defines = [ "CDM_IMPLEMENTATION" ]
84
85 deps = [
86 ":version_h",
87 "//base",
88 ]
89
90 if (is_mac) {
91 ldflags = [
92 # Not to strip important symbols by -Wl,-dead_strip.
93 "-Wl,-exported_symbol,_PPP_GetInterface",
94 "-Wl,-exported_symbol,_PPP_InitializeModule",
95 "-Wl,-exported_symbol,_PPP_ShutdownModule",
96 ]
97 #TODO(GYP) Mac: 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
98 } else if (is_posix && !is_mac) {
99 cflags = [ "-fvisibility=hidden" ]
100 # Note GYP sets rpath but this is set by default on shared libraries in
101 # the GN build.
102 }
103 }
104 } else {
105 group("widevinecdm") {
106 # NOP
107 }
75 } 108 }
76 109
77 if (is_chrome_branded && enable_pepper_cdms) { 110 if ((is_chrome_branded || enable_widevine) && enable_pepper_cdms) {
78 adapter_resource_file = "$target_gen_dir/widevinecdmadapter_version.rc" 111 adapter_resource_file = "$target_gen_dir/widevinecdmadapter_version.rc"
79 112
80 # Produce the .rc file. 113 # Produce the .rc file.
81 process_version("adapter_resources") { 114 process_version("widevinecdmadapter_resources") {
82 visibility = [ ":*" ] 115 visibility = [ ":*" ]
83 sources = [ 116 sources = [
84 "BRANDING", 117 "BRANDING",
85 "widevinecdmadapter.ver", 118 "widevinecdmadapter.ver",
86 ] 119 ]
87 output = adapter_resource_file 120 output = adapter_resource_file
88 } 121 }
89 122
90 cdm_adapter("adapter") { 123 cdm_adapter("widevinecdmadapter") {
91 sources = [ 124 sources = [
92 adapter_resource_file, 125 adapter_resource_file,
93 ] 126 ]
94 deps = [ 127 deps = [
95 ":adapter_resources", 128 ":widevinecdmadapter_resources",
96 ":binaries", 129 ":widevinecdm",
97 ":version_h", 130 ":version_h",
98 "//ppapi/cpp", 131 "//ppapi/cpp",
99 ] 132 ]
100 133
101 if (is_linux) { 134 if (is_linux) {
102 ldflags = 135 ldflags =
103 [ rebase_path("$root_out_dir/libwidevinecdm.so", root_build_dir) ] 136 [ rebase_path("$root_out_dir/libwidevinecdm.so", root_build_dir) ]
jrummell 2015/04/09 21:44:17 Not sure if the rebase_path() is needed now that t
DaleCurtis 2015/04/13 18:35:58 Does it build without it ? :)
jrummell 2015/04/13 22:22:35 It does. However, this appears to be the standard
104 libs = [ "rt" ] 137 libs = [ "rt" ]
105 } else if (is_win) { 138 } else if (is_win) {
106 ldflags = 139 ldflags =
107 [ rebase_path("$root_out_dir/widevinecdm.dll.lib", root_build_dir) ] 140 [ rebase_path("$root_out_dir/widevinecdm.dll.lib", root_build_dir) ]
108 } else if (is_mac) { 141 } else if (is_mac) {
109 ldflags = 142 ldflags =
110 [ rebase_path("$root_out_dir/libwidevinecdm.dylib", root_build_dir) ] 143 [ rebase_path("$root_out_dir/libwidevinecdm.dylib", root_build_dir) ]
111 } 144 }
112 } 145 }
113 } else { 146 } else {
114 # Placeholder when we're not compiling the adapter. 147 # Placeholder when we're not compiling the adapter.
115 group("adapter") { 148 group("widevinecdmadapter") {
116 } 149 }
117 } 150 }
118 151
119 # This target exists for tests to depend on that pulls in a runtime dependency 152 # This target exists for tests to depend on that pulls in a runtime dependency
120 # on the license server. 153 # on the license server.
121 source_set("widevine_test_license_server") { 154 source_set("widevine_test_license_server") {
122 if (is_chrome_branded && is_linux) { 155 if (is_chrome_branded && is_linux) {
123 deps = [ 156 deps = [
124 # TODO(GYP) 157 # TODO(GYP)
125 # This target should be removed and targets should have datadeps on this t arget: 158 # This target should be removed and targets should have datadeps on this t arget:
126 #"//third_party/widevine/test/license_server/license_server.gyp:test_licen se_server" 159 #"//third_party/widevine/test/license_server/license_server.gyp:test_licen se_server"
127 ] 160 ]
128 } 161 }
129 } 162 }
OLDNEW
« 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