forked from Alex313031/thorium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6d2575
commit 5e64a60
Showing
7 changed files
with
125 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
# Copyright 2023 The Chromium Authors and Alex313031 | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import("//build/buildflag_header.gni") | ||
import("//build/config/chrome_build.gni") | ||
import("//build/config/chromeos/ui_mode.gni") | ||
import("//build/config/chromeos/ui_mode.gni") | ||
import("//build/config/features.gni") | ||
import("//build/toolchain/toolchain.gni") | ||
import("//media/media_options.gni") | ||
import("//third_party/widevine/cdm/widevine.gni") | ||
|
||
if (bundle_widevine_cdm) { | ||
import("//media/cdm/library_cdm/cdm_paths.gni") | ||
} | ||
|
||
assert(!bundle_widevine_cdm || (enable_widevine && enable_library_cdms)) | ||
|
||
buildflag_header("buildflags") { | ||
header = "buildflags.h" | ||
|
||
flags = [ | ||
"ENABLE_WIDEVINE=$enable_widevine", | ||
"BUNDLE_WIDEVINE_CDM=$bundle_widevine_cdm", | ||
"ENABLE_WIDEVINE_CDM_COMPONENT=$enable_widevine_cdm_component", | ||
"ENABLE_MEDIA_FOUNDATION_WIDEVINE_CDM=$enable_media_foundation_widevine_cdm", | ||
] | ||
} | ||
|
||
# TODO(xhwang): widevine_cdm_version.h is only used in few places. Clean this up | ||
# so we don't need to copy it in most cases. | ||
# Also, merge the bundle_widevine_cdm blocks as much as possible. | ||
if (bundle_widevine_cdm) { | ||
widevine_arch = target_cpu | ||
|
||
widevine_cdm_root = "${widevine_root}/${target_os}/${widevine_arch}" | ||
cdm_file_name = "${shlib_prefix}widevinecdm${shlib_extension}" | ||
|
||
widevine_cdm_version_h_file = "${widevine_cdm_root}/widevine_cdm_version.h" | ||
widevine_cdm_binary_files = [ "${widevine_cdm_root}/${cdm_file_name}" ] | ||
widevine_cdm_manifest_and_license_files = [ | ||
"${widevine_cdm_root}/manifest.json", | ||
"../LICENSE", | ||
] | ||
|
||
if (enable_widevine_cdm_host_verification) { | ||
assert(target_os == "win" || is_mac) | ||
widevine_cdm_binary_files += [ "${widevine_cdm_root}/${cdm_file_name}.sig" ] | ||
widevine_cdm_binary_files += [ "${widevine_cdm_root}/${cdm_file_name}.lib" ] | ||
} | ||
} else { | ||
# The CDM is not bundled. Use the default file. | ||
widevine_cdm_version_h_file = "widevine_cdm_version.h" | ||
} | ||
|
||
copy("version_h") { | ||
visibility = [ ":*" ] # Depend on ":headers" instead. | ||
sources = [ widevine_cdm_version_h_file ] | ||
|
||
# TODO(brettw) this should go into target_out_dir and callers should include | ||
# it from there. This requires, however, renaming the default | ||
# widevine_cdm_version.h in this directory to avoid conflicts. | ||
outputs = [ "${root_gen_dir}/widevine_cdm_version.h" ] | ||
} | ||
|
||
source_set("headers") { | ||
public = [ "widevine_cdm_common.h" ] | ||
|
||
public_deps = [ | ||
":buildflags", | ||
":version_h", # Forward permission to use version header. | ||
"//base", | ||
] | ||
} | ||
|
||
if (bundle_widevine_cdm) { | ||
copy("widevine_cdm_manifest_and_license") { | ||
sources = widevine_cdm_manifest_and_license_files | ||
outputs = [ "${root_out_dir}/WidevineCdm/{{source_file_part}}" ] | ||
} | ||
|
||
copy("widevine_cdm_binary") { | ||
sources = widevine_cdm_binary_files | ||
outputs = [ "${root_out_dir}/${widevine_cdm_path}/{{source_file_part}}" ] | ||
|
||
# TODO(jrummell) | ||
# 'COPY_PHASE_STRIP': 'NO', | ||
} | ||
|
||
group("cdm") { | ||
# Needed at run time by tests, e.g. swarming tests to generate isolate. | ||
# See https://crbug.com/824493 for context. | ||
data_deps = [ | ||
":widevine_cdm_binary", | ||
":widevine_cdm_manifest_and_license", | ||
] | ||
|
||
# Needed at build time e.g. for mac bundle (//chrome:chrome_framework). | ||
public_deps = [ | ||
":widevine_cdm_binary", | ||
":widevine_cdm_manifest_and_license", | ||
] | ||
} | ||
} else { | ||
group("cdm") { | ||
# NOP | ||
} | ||
} | ||
|
||
# This target exists for tests to depend on that pulls in a runtime dependency | ||
# on the license server. | ||
group("widevine_test_license_server") { | ||
if (bundle_widevine_cdm && (is_linux || is_chromeos)) { | ||
data = [ "//third_party/widevine/test/license_server/" ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters