| OLD | NEW |
| 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 Loading... |
| 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 != []) { |
| 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(jrummell) |
| 73 # 'COPY_PHASE_STRIP': 'NO', | 73 # 'COPY_PHASE_STRIP': 'NO', |
| 74 } | 74 } |
| 75 } else if (enable_widevine && enable_pepper_cdms) { |
| 76 assert(!is_chrome_branded, "Branded Chrome should have binary files to copy.") |
| 77 assert(!is_android, "Android should not have enable_pepper_cdms.") |
| 78 shared_library("widevinecdm") { |
| 79 sources = [ |
| 80 "//media/cdm/stub/stub_cdm.cc", |
| 81 "//media/cdm/stub/stub_cdm.h", |
| 82 ] |
| 83 |
| 84 defines = [ "CDM_IMPLEMENTATION" ] |
| 85 |
| 86 deps = [ |
| 87 ":version_h", |
| 88 "//base", |
| 89 ] |
| 90 |
| 91 if (is_mac) { |
| 92 ldflags = [ |
| 93 # Not to strip important symbols by -Wl,-dead_strip. |
| 94 "-Wl,-exported_symbol,_PPP_GetInterface", |
| 95 "-Wl,-exported_symbol,_PPP_InitializeModule", |
| 96 "-Wl,-exported_symbol,_PPP_ShutdownModule", |
| 97 ] |
| 98 #TODO(jrummell) Mac: 'DYLIB_INSTALL_NAME_BASE': '@loader_path', |
| 99 } else if (is_posix && !is_mac) { |
| 100 cflags = [ "-fvisibility=hidden" ] |
| 101 # Note GYP sets rpath but this is set by default on shared libraries in |
| 102 # the GN build. |
| 103 } |
| 104 } |
| 105 } else { |
| 106 group("widevinecdm") { |
| 107 # NOP |
| 108 } |
| 75 } | 109 } |
| 76 | 110 |
| 77 if (is_chrome_branded && enable_pepper_cdms) { | 111 if ((is_chrome_branded || enable_widevine) && enable_pepper_cdms) { |
| 78 adapter_resource_file = "$target_gen_dir/widevinecdmadapter_version.rc" | 112 adapter_resource_file = "$target_gen_dir/widevinecdmadapter_version.rc" |
| 79 | 113 |
| 80 # Produce the .rc file. | 114 # Produce the .rc file. |
| 81 process_version("adapter_resources") { | 115 process_version("widevinecdmadapter_resources") { |
| 82 visibility = [ ":*" ] | 116 visibility = [ ":*" ] |
| 83 sources = [ | 117 sources = [ |
| 84 "BRANDING", | 118 "BRANDING", |
| 85 "widevinecdmadapter.ver", | 119 "widevinecdmadapter.ver", |
| 86 ] | 120 ] |
| 87 output = adapter_resource_file | 121 output = adapter_resource_file |
| 88 } | 122 } |
| 89 | 123 |
| 90 cdm_adapter("adapter") { | 124 cdm_adapter("widevinecdmadapter") { |
| 91 sources = [ | 125 sources = [ |
| 92 adapter_resource_file, | 126 adapter_resource_file, |
| 93 ] | 127 ] |
| 94 deps = [ | 128 deps = [ |
| 95 ":adapter_resources", | 129 ":widevinecdmadapter_resources", |
| 96 ":binaries", | 130 ":widevinecdm", |
| 97 ":version_h", | 131 ":version_h", |
| 98 "//ppapi/cpp", | 132 "//ppapi/cpp", |
| 99 ] | 133 ] |
| 100 | 134 |
| 101 if (is_linux) { | 135 if (is_linux) { |
| 102 ldflags = | 136 ldflags = |
| 103 [ rebase_path("$root_out_dir/libwidevinecdm.so", root_build_dir) ] | 137 [ rebase_path("$root_out_dir/libwidevinecdm.so", root_build_dir) ] |
| 104 libs = [ "rt" ] | 138 libs = [ "rt" ] |
| 105 } else if (is_win) { | 139 } else if (is_win) { |
| 106 ldflags = | 140 ldflags = |
| 107 [ rebase_path("$root_out_dir/widevinecdm.dll.lib", root_build_dir) ] | 141 [ rebase_path("$root_out_dir/widevinecdm.dll.lib", root_build_dir) ] |
| 108 } else if (is_mac) { | 142 } else if (is_mac) { |
| 109 ldflags = | 143 ldflags = |
| 110 [ rebase_path("$root_out_dir/libwidevinecdm.dylib", root_build_dir) ] | 144 [ rebase_path("$root_out_dir/libwidevinecdm.dylib", root_build_dir) ] |
| 111 } | 145 } |
| 112 } | 146 } |
| 113 } else { | 147 } else { |
| 114 # Placeholder when we're not compiling the adapter. | 148 # Placeholder when we're not compiling the adapter. |
| 115 group("adapter") { | 149 group("widevinecdmadapter") { |
| 116 } | 150 } |
| 117 } | 151 } |
| 118 | 152 |
| 119 # This target exists for tests to depend on that pulls in a runtime dependency | 153 # This target exists for tests to depend on that pulls in a runtime dependency |
| 120 # on the license server. | 154 # on the license server. |
| 121 source_set("widevine_test_license_server") { | 155 source_set("widevine_test_license_server") { |
| 122 if (is_chrome_branded && is_linux) { | 156 if (is_chrome_branded && is_linux) { |
| 123 deps = [ | 157 deps = [ |
| 124 # TODO(GYP) | 158 # TODO(jrummell) |
| 125 # This target should be removed and targets should have datadeps on this t
arget: | 159 # 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" | 160 #"//third_party/widevine/test/license_server/license_server.gyp:test_licen
se_server" |
| 127 ] | 161 ] |
| 128 } | 162 } |
| 129 } | 163 } |
| OLD | NEW |