mirror of
https://github.com/electron/electron.git
synced 2026-10-28 11:44:46 +08:00
* refactor: use PreloadRealmGlobalScope for service worker preloads
Service worker preload scripts ran in Blink's ShadowRealmGlobalScope.
The ShadowRealm proposal has stalled, so Chromium may remove that class.
A new Chromium patch adds PreloadRealmGlobalScope, a global scope that
exposes the same interfaces without depending on any ShadowRealm code,
and Electron now creates the preload context with it.
Uncaught errors and unhandled rejections in a service worker preload
script are now reported through the worker's console. Before, they hit
NOTREACHED() in ShadowRealmGlobalScope.
Calling getEventListeners() from the DevTools console in the preload
context no longer crashes the renderer.
* refactor: generate PreloadRealmGlobalScope IDL bindings in //electron
* ci: normalize include paths in Windows gen headers for clang-tidy
The Windows clang-tidy job runs in a Linux container using generated
headers downloaded from out_gen_artifacts_win_x64. On Windows, Python
code generators such as inspector_protocol/code_generator.py use
os.path.join() and emit backslashes in #include directives, causing
Linux Siso scandeps and clang-tidy on RBE workers to fail with:
gen/third_party/blink/renderer/core/inspector/protocol/forward.h:15:10: error: 'third_party/inspector_protocol\crdtp/error_support.h' file not found [clang-diagnostic-error]
15 | #include "third_party/inspector_protocol\crdtp/error_support.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* fixup! normalize include paths in Windows gen headers for clang-tidy
* fix: resolve root worker context for ShadowRealms nested in preload realms
When a ShadowRealm is created inside a service worker preload realm
(e.g. with --harmony-shadow-realm), its initiator ExecutionContext is
PreloadRealmGlobalScope rather than a WorkerOrWorkletGlobalScope or
ShadowRealmGlobalScope. Previously, GetRootInitiatorExecutionContext()
only walked initiators via To<ShadowRealmGlobalScope>(), which either
stopped at PreloadRealmGlobalScope (failing the subsequent
To<WorkerOrWorkletGlobalScope>() cast on unhandled rejections or console
messages) or performed an invalid downcast to ShadowRealmGlobalScope.
Delegate GetRootInitiatorExecutionContext() to
initiator_execution_context_->GetRootExecutionContext() so nested
ShadowRealms walk through PreloadRealmGlobalScope to the underlying
ServiceWorkerGlobalScope.
* fix: use Supplement<ExecutionContext> for PreloadRealmLifetimeController
Replace V8 embedder data slot storage in PreloadRealmLifetimeController with
blink::Supplement<ExecutionContext> so it cannot collide with NodeBindings
storing node::IsolateData* in kElectronContextEmbedderDataIndex
or require a persistent self root.
* build: track blink pydeps
* chore: update patches
---------
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
2358 lines
77 KiB
Plaintext
2358 lines
77 KiB
Plaintext
import("//build/config/locales.gni")
|
|
import("//build/config/ui.gni")
|
|
import("//build/config/win/manifest.gni")
|
|
import("//components/spellcheck/spellcheck_build_features.gni")
|
|
import("//content/public/app/mac_helpers.gni")
|
|
import("//content/public/common/features.gni")
|
|
import("//extensions/buildflags/buildflags.gni")
|
|
import("//pdf/features.gni")
|
|
import("//printing/buildflags/buildflags.gni")
|
|
import("//testing/test.gni")
|
|
import("//third_party/electron_node/node.gni")
|
|
import("//third_party/ffmpeg/ffmpeg_options.gni")
|
|
import("//tools/generate_library_loader/generate_library_loader.gni")
|
|
import("//tools/grit/grit_rule.gni")
|
|
import("//tools/grit/repack.gni")
|
|
import("//tools/resources/generate_resource_allowlist.gni")
|
|
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
|
|
import("//v8/gni/snapshot_toolchain.gni")
|
|
import("//v8/gni/v8.gni")
|
|
import("build/asar.gni")
|
|
import("build/bundle/bundle.gni")
|
|
import("build/electron_paks.gni")
|
|
import("build/extract_symbols.gni")
|
|
import("build/js2c_toolchain.gni")
|
|
import("build/npm.gni")
|
|
import("build/templated_file.gni")
|
|
import("build/tsc.gni")
|
|
import("buildflags/buildflags.gni")
|
|
import("filenames.auto.gni")
|
|
import("filenames.gni")
|
|
import("filenames.hunspell.gni")
|
|
import("filenames.libcxx.gni")
|
|
import("filenames.libcxxabi.gni")
|
|
|
|
declare_args() {
|
|
# Emit a build-time V8 code cache for the internal/electron/js2c/* bundles.
|
|
# When false an empty stub is compiled and bundles compile from source.
|
|
#
|
|
# Cross-arch is supported: the generator is built in v8_snapshot_toolchain
|
|
# (V8_TARGET_ARCH set to the target) and reads the target's snapshot blob,
|
|
# so the cache it emits is keyed to the target's read-only checksum -- the
|
|
# same mechanism that makes V8's mksnapshot cross-arch correct. Cross-OS is
|
|
# untested and stays off.
|
|
electron_generate_js2c_code_cache = host_os == target_os
|
|
}
|
|
|
|
if (is_mac) {
|
|
import("//build/config/mac/rules.gni")
|
|
import("//third_party/icu/config.gni")
|
|
import("build/rules.gni")
|
|
|
|
assert(
|
|
mac_deployment_target == "13.0",
|
|
"Chromium has updated the mac_deployment_target, please update this assert and flag this as a breaking change (docs/breaking-changes.md)")
|
|
|
|
# shell/browser/feature_list_mac.mm enables this unexported content feature
|
|
# by name; fail here rather than silently if a Chromium roll removes it.
|
|
assert(
|
|
filter_include(
|
|
read_file(
|
|
"//content/browser/renderer_host/render_widget_host_view_mac.mm",
|
|
"list lines"),
|
|
[ "BASE_FEATURE(kThrottleResizeIpc,*" ]) != [],
|
|
"kThrottleResizeIpc is gone from render_widget_host_view_mac.mm; update shell/browser/feature_list_mac.mm")
|
|
}
|
|
|
|
if (is_linux) {
|
|
import("//build/config/linux/pkg_config.gni")
|
|
import("//electron/build/linux/strip_binary.gni")
|
|
import("//tools/generate_stubs/rules.gni")
|
|
|
|
pkg_config("gio_unix") {
|
|
packages = [ "gio-unix-2.0" ]
|
|
}
|
|
|
|
pkg_config("libnotify_config") {
|
|
packages = [
|
|
"glib-2.0",
|
|
"gdk-pixbuf-2.0",
|
|
]
|
|
}
|
|
|
|
generate_library_loader("libnotify_loader") {
|
|
name = "LibNotifyLoader"
|
|
output_h = "libnotify_loader.h"
|
|
output_cc = "libnotify_loader.cc"
|
|
header = "<libnotify/notify.h>"
|
|
config = ":libnotify_config"
|
|
|
|
functions = [
|
|
"notify_is_initted",
|
|
"notify_init",
|
|
"notify_get_server_caps",
|
|
"notify_get_server_info",
|
|
"notify_notification_new",
|
|
"notify_notification_add_action",
|
|
"notify_notification_set_image_from_pixbuf",
|
|
"notify_notification_set_timeout",
|
|
"notify_notification_set_urgency",
|
|
"notify_notification_set_hint",
|
|
"notify_notification_show",
|
|
"notify_notification_close",
|
|
]
|
|
}
|
|
|
|
# Generates headers which contain stubs for extracting function ptrs
|
|
# from the gtk library. Function signatures for which stubs are
|
|
# required should be declared in the sig files.
|
|
generate_stubs("electron_gtk_stubs") {
|
|
sigs = [
|
|
"shell/browser/ui/electron_gdk.sigs",
|
|
"shell/browser/ui/electron_gdk_pixbuf.sigs",
|
|
"shell/browser/ui/electron_gtk.sigs",
|
|
]
|
|
extra_header = "shell/browser/ui/electron_gtk.fragment"
|
|
output_name = "electron_gtk_stubs"
|
|
public_deps = [ "//ui/gtk:gtk_config" ]
|
|
logging_function = "LogNoop()"
|
|
logging_include = "ui/gtk/log_noop.h"
|
|
}
|
|
}
|
|
|
|
branding = read_file("shell/app/BRANDING.json", "json")
|
|
electron_project_name = branding.project_name
|
|
electron_product_name = branding.product_name
|
|
electron_mac_bundle_id = branding.mac_bundle_id
|
|
|
|
if (override_electron_version != "") {
|
|
electron_version = override_electron_version
|
|
} else {
|
|
# When building from a source code tarball there is no git tag available and
|
|
# builders must explicitly pass override_electron_version in gn args.
|
|
#
|
|
# Resolve the real locations of packed-refs and HEAD via git so that this
|
|
# also works when electron/ is a `git worktree` (where .git is a file, not a
|
|
# directory, and GN's read_file cannot follow the gitdir indirection).
|
|
electron_git_ref_paths =
|
|
exec_script("script/get-git-ref-paths.py", [], "list lines")
|
|
|
|
# This read_file call will assert if there is no git information, without it
|
|
# gn will generate a malformed build configuration and ninja will get into
|
|
# infinite loop.
|
|
read_file(electron_git_ref_paths[0], "string")
|
|
|
|
# Set electron version from git tag.
|
|
electron_version = exec_script("script/get-git-version.py",
|
|
[],
|
|
"trim string",
|
|
electron_git_ref_paths)
|
|
}
|
|
|
|
if (is_mas_build) {
|
|
assert(is_mac,
|
|
"It doesn't make sense to build a MAS build on a non-mac platform")
|
|
}
|
|
|
|
if (enable_pdf_viewer) {
|
|
assert(enable_pdf, "PDF viewer support requires enable_pdf=true")
|
|
assert(enable_electron_extensions,
|
|
"PDF viewer support requires enable_electron_extensions=true")
|
|
}
|
|
|
|
if (enable_electron_extensions) {
|
|
assert(enable_extensions,
|
|
"Chrome extension support requires enable_extensions=true")
|
|
}
|
|
|
|
config("branding") {
|
|
defines = [
|
|
"ELECTRON_PRODUCT_NAME=\"$electron_product_name\"",
|
|
"ELECTRON_PROJECT_NAME=\"$electron_project_name\"",
|
|
]
|
|
}
|
|
|
|
config("electron_lib_config") {
|
|
include_dirs = [ "." ]
|
|
cflags = []
|
|
if (is_clang && clang_use_chrome_plugins) {
|
|
# The plugin is built directly into clang, so there's no need to load it
|
|
# dynamically.
|
|
cflags += [
|
|
"-Xclang",
|
|
"-add-plugin",
|
|
"-Xclang",
|
|
"blink-gc-plugin",
|
|
"-Xclang",
|
|
"-plugin-arg-blink-gc-plugin",
|
|
"-Xclang",
|
|
"check-directory=electron/shell/",
|
|
"-Xclang",
|
|
"-plugin-arg-blink-gc-plugin",
|
|
"-Xclang",
|
|
"check-directory=gin/",
|
|
]
|
|
}
|
|
}
|
|
|
|
# electron.d.ts is generated into the repo root (//electron/electron.d.ts) — a
|
|
# single shared path consumed via the /// <reference> in
|
|
# typings/internal-electron.d.ts — plus a per-toolchain gen-dir copy. Because
|
|
# the repo-root write is a fixed shared path, instantiating this action in more
|
|
# than one toolchain races two concurrent truncate-then-write generators on it.
|
|
# Generate it once in the default toolchain and forward to that instance
|
|
# everywhere else. The lib/ type check only depends on source files, so there is
|
|
# no point repeating it per toolchain either.
|
|
if (current_toolchain == default_toolchain) {
|
|
npm_action("build_electron_definitions") {
|
|
script = "gn-typescript-definitions"
|
|
args = [ rebase_path("$target_gen_dir/tsc/typings/electron.d.ts") ]
|
|
inputs = auto_filenames.api_docs + [ "yarn.lock" ]
|
|
|
|
outputs = [ "$target_gen_dir/tsc/typings/electron.d.ts" ]
|
|
}
|
|
|
|
# Type checks lib/ against tsconfig.electron.json for the electron_bundle
|
|
# targets below, which only strip types.
|
|
npm_action("electron_lib_typecheck") {
|
|
deps = [ ":build_electron_definitions" ]
|
|
|
|
script = "typecheck"
|
|
inputs = auto_filenames.lib_typecheck_sources + [ "yarn.lock" ]
|
|
outputs = [ "$target_gen_dir/electron_lib_typecheck.stamp" ]
|
|
args = [
|
|
"--project",
|
|
rebase_path("tsconfig.electron.json"),
|
|
"--stamp",
|
|
rebase_path(outputs[0]),
|
|
]
|
|
}
|
|
} else {
|
|
group("build_electron_definitions") {
|
|
public_deps = [ ":build_electron_definitions($default_toolchain)" ]
|
|
}
|
|
|
|
group("electron_lib_typecheck") {
|
|
public_deps = [ ":electron_lib_typecheck($default_toolchain)" ]
|
|
}
|
|
}
|
|
|
|
electron_bundle("electron_browser_bundle") {
|
|
bundle = "browser"
|
|
inputs = auto_filenames.browser_bundle_deps
|
|
out_file = "$root_gen_dir/internal/electron/js2c/browser_init.js"
|
|
}
|
|
|
|
electron_bundle("electron_renderer_bundle") {
|
|
bundle = "renderer"
|
|
inputs = auto_filenames.renderer_bundle_deps
|
|
out_file = "$root_gen_dir/internal/electron/js2c/renderer_init.js"
|
|
}
|
|
|
|
electron_bundle("electron_worker_bundle") {
|
|
bundle = "worker"
|
|
inputs = auto_filenames.worker_bundle_deps
|
|
out_file = "$root_gen_dir/internal/electron/js2c/worker_init.js"
|
|
}
|
|
|
|
electron_bundle("electron_webview_bundle") {
|
|
bundle = "webview"
|
|
inputs = auto_filenames.webview_bundle_deps
|
|
out_file = "$root_gen_dir/internal/electron/js2c/webview_bundle.js"
|
|
}
|
|
|
|
electron_bundle("electron_isolated_renderer_bundle") {
|
|
bundle = "isolated_renderer"
|
|
inputs = auto_filenames.isolated_bundle_deps
|
|
out_file = "$root_gen_dir/internal/electron/js2c/isolated_bundle.js"
|
|
}
|
|
|
|
electron_bundle("electron_node_bundle") {
|
|
bundle = "node"
|
|
inputs = auto_filenames.node_bundle_deps
|
|
out_file = "$root_gen_dir/internal/electron/js2c/node_init.js"
|
|
}
|
|
|
|
electron_bundle("electron_utility_bundle") {
|
|
bundle = "utility"
|
|
inputs = auto_filenames.utility_bundle_deps
|
|
out_file = "$root_gen_dir/internal/electron/js2c/utility_init.js"
|
|
}
|
|
|
|
action("electron_js2c") {
|
|
deps = [
|
|
":electron_browser_bundle",
|
|
":electron_isolated_renderer_bundle",
|
|
":electron_node_bundle",
|
|
":electron_renderer_bundle",
|
|
":electron_utility_bundle",
|
|
":electron_webview_bundle",
|
|
":electron_worker_bundle",
|
|
"//third_party/electron_node:node_js2c($electron_js2c_toolchain)",
|
|
]
|
|
|
|
sources = [
|
|
"$root_gen_dir/internal/electron/js2c/browser_init.js",
|
|
"$root_gen_dir/internal/electron/js2c/isolated_bundle.js",
|
|
"$root_gen_dir/internal/electron/js2c/node_init.js",
|
|
"$root_gen_dir/internal/electron/js2c/renderer_init.js",
|
|
"$root_gen_dir/internal/electron/js2c/utility_init.js",
|
|
"$root_gen_dir/internal/electron/js2c/webview_bundle.js",
|
|
"$root_gen_dir/internal/electron/js2c/worker_init.js",
|
|
]
|
|
|
|
inputs = sources
|
|
outputs = [ "$root_gen_dir/electron_natives.cc" ]
|
|
|
|
script = "build/js2c.py"
|
|
out_dir =
|
|
get_label_info(":anything($electron_js2c_toolchain)", "root_out_dir")
|
|
args = [
|
|
rebase_path("$out_dir/node_js2c"),
|
|
rebase_path("$root_gen_dir"),
|
|
] + rebase_path(outputs, root_gen_dir) +
|
|
rebase_path(sources, root_gen_dir)
|
|
}
|
|
|
|
action("generate_config_gypi") {
|
|
outputs = [ "$root_gen_dir/config.gypi" ]
|
|
script = "script/generate-config-gypi.py"
|
|
inputs = [ "//third_party/electron_node/configure.py" ]
|
|
args = rebase_path(outputs) + [ target_cpu ]
|
|
}
|
|
|
|
target_gen_default_app_js = "$target_gen_dir/js/default_app"
|
|
|
|
typescript_build("default_app_js") {
|
|
deps = [ ":build_electron_definitions" ]
|
|
|
|
sources = filenames.default_app_ts_sources
|
|
|
|
output_gen_dir = target_gen_default_app_js
|
|
output_dir_name = "default_app"
|
|
tsconfig = "tsconfig.default_app.json"
|
|
}
|
|
|
|
copy("default_app_static") {
|
|
sources = filenames.default_app_static_sources
|
|
outputs = [ "$target_gen_default_app_js/{{source}}" ]
|
|
}
|
|
|
|
asar("default_app_asar") {
|
|
deps = [
|
|
":default_app_js",
|
|
":default_app_static",
|
|
]
|
|
|
|
root = "$target_gen_default_app_js/electron/default_app"
|
|
sources = get_target_outputs(":default_app_js") +
|
|
get_target_outputs(":default_app_static")
|
|
outputs = [ "$root_out_dir/resources/default_app.asar" ]
|
|
}
|
|
|
|
grit("resources") {
|
|
source = "build/electron_resources.grd"
|
|
|
|
outputs = [
|
|
"grit/electron_resources.h",
|
|
"electron_resources.pak",
|
|
]
|
|
if (translate_genders) {
|
|
outputs += [
|
|
"electron_resources_MASCULINE.pak",
|
|
"electron_resources_FEMININE.pak",
|
|
"electron_resources_NEUTER.pak",
|
|
]
|
|
}
|
|
|
|
foreach(locale, all_chrome_locales) {
|
|
outputs += [ "electron_strings_$locale.pak" ]
|
|
if (translate_genders) {
|
|
outputs += [
|
|
"electron_strings_${locale}_MASCULINE.pak",
|
|
"electron_strings_${locale}_FEMININE.pak",
|
|
"electron_strings_${locale}_NEUTER.pak",
|
|
]
|
|
}
|
|
}
|
|
|
|
# Mojo manifest overlays are generated.
|
|
grit_flags = [
|
|
"-E",
|
|
"target_gen_dir=" + rebase_path(target_gen_dir, root_build_dir),
|
|
]
|
|
if (translate_genders) {
|
|
grit_flags += [ "--translate-genders" ]
|
|
}
|
|
|
|
deps = [ ":copy_shell_devtools_discovery_page" ]
|
|
|
|
output_dir = "$target_gen_dir"
|
|
}
|
|
|
|
copy("copy_shell_devtools_discovery_page") {
|
|
sources = [ "//content/shell/resources/shell_devtools_discovery_page.html" ]
|
|
outputs = [ "$target_gen_dir/shell_devtools_discovery_page.html" ]
|
|
}
|
|
|
|
npm_action("electron_version_args") {
|
|
script = "generate-version-json"
|
|
|
|
outputs = [ "$target_gen_dir/electron_version.args" ]
|
|
|
|
args = rebase_path(outputs) + [ "$electron_version" ]
|
|
|
|
inputs = [ "script/generate-version-json.js" ]
|
|
}
|
|
|
|
templated_file("electron_version_header") {
|
|
deps = [ ":electron_version_args" ]
|
|
|
|
template = "build/templates/electron_version.tmpl"
|
|
output = "$target_gen_dir/electron_version.h"
|
|
|
|
args_files = get_target_outputs(":electron_version_args")
|
|
}
|
|
|
|
templated_file("electron_win_rc") {
|
|
deps = [ ":electron_version_args" ]
|
|
|
|
template = "build/templates/electron_rc.tmpl"
|
|
output = "$target_gen_dir/win-resources/electron.rc"
|
|
|
|
args_files = get_target_outputs(":electron_version_args")
|
|
}
|
|
|
|
copy("electron_win_resource_files") {
|
|
sources = [
|
|
"shell/browser/resources/win/electron.ico",
|
|
"shell/browser/resources/win/resource.h",
|
|
]
|
|
outputs = [ "$target_gen_dir/win-resources/{{source_file_part}}" ]
|
|
}
|
|
|
|
templated_file("electron_version_file") {
|
|
deps = [ ":electron_version_args" ]
|
|
|
|
template = "build/templates/version_string.tmpl"
|
|
output = "$root_build_dir/version"
|
|
|
|
args_files = get_target_outputs(":electron_version_args")
|
|
}
|
|
|
|
group("electron_win32_resources") {
|
|
public_deps = [
|
|
":electron_win_rc",
|
|
":electron_win_resource_files",
|
|
]
|
|
}
|
|
|
|
action("electron_fuses") {
|
|
script = "build/fuses/build.py"
|
|
|
|
inputs = [ "build/fuses/fuses.json5" ]
|
|
|
|
outputs = [
|
|
"$target_gen_dir/fuses.h",
|
|
"$target_gen_dir/fuses.cc",
|
|
]
|
|
|
|
args = rebase_path(outputs)
|
|
}
|
|
|
|
action("electron_generate_node_defines") {
|
|
script = "build/generate_node_defines.py"
|
|
|
|
inputs = [
|
|
"//third_party/electron_node/src/tracing/trace_event_common.h",
|
|
"//third_party/electron_node/src/tracing/trace_event.h",
|
|
"//third_party/electron_node/src/util.h",
|
|
]
|
|
|
|
outputs = [
|
|
"$target_gen_dir/push_and_undef_node_defines.h",
|
|
"$target_gen_dir/pop_node_defines.h",
|
|
]
|
|
|
|
args = [ rebase_path(target_gen_dir) ] + rebase_path(inputs)
|
|
}
|
|
|
|
action("electron_generate_preload_realm_bindings") {
|
|
script = "build/generate_preload_realm_bindings.py"
|
|
|
|
core_idl_files = [
|
|
"//third_party/blink/renderer/core/dom/abort_controller.idl",
|
|
"//third_party/blink/renderer/core/dom/abort_signal.idl",
|
|
"//third_party/blink/renderer/core/dom/dom_exception.idl",
|
|
"//third_party/blink/renderer/core/dom/events/custom_event.idl",
|
|
"//third_party/blink/renderer/core/dom/events/event.idl",
|
|
"//third_party/blink/renderer/core/dom/events/event_target.idl",
|
|
"//third_party/blink/renderer/core/dom/observable.idl",
|
|
"//third_party/blink/renderer/core/dom/quota_exceeded_error.idl",
|
|
"//third_party/blink/renderer/core/dom/subscriber.idl",
|
|
"//third_party/blink/renderer/core/dom/void_function.idl",
|
|
"//third_party/blink/renderer/core/events/error_event.idl",
|
|
"//third_party/blink/renderer/core/events/promise_rejection_event.idl",
|
|
"//third_party/blink/renderer/core/frame/universal_global_scope.idl",
|
|
"//third_party/blink/renderer/core/messaging/structured_serialize_options.idl",
|
|
"//third_party/blink/renderer/core/streams/byte_length_queuing_strategy.idl",
|
|
"//third_party/blink/renderer/core/streams/count_queuing_strategy.idl",
|
|
"//third_party/blink/renderer/core/streams/readable_byte_stream_controller.idl",
|
|
"//third_party/blink/renderer/core/streams/readable_stream.idl",
|
|
"//third_party/blink/renderer/core/streams/readable_stream_byob_reader.idl",
|
|
"//third_party/blink/renderer/core/streams/readable_stream_byob_request.idl",
|
|
"//third_party/blink/renderer/core/streams/readable_stream_default_controller.idl",
|
|
"//third_party/blink/renderer/core/streams/readable_stream_default_reader.idl",
|
|
"//third_party/blink/renderer/core/streams/transform_stream.idl",
|
|
"//third_party/blink/renderer/core/streams/transform_stream_default_controller.idl",
|
|
"//third_party/blink/renderer/core/streams/writable_stream.idl",
|
|
"//third_party/blink/renderer/core/streams/writable_stream_default_controller.idl",
|
|
"//third_party/blink/renderer/core/streams/writable_stream_default_writer.idl",
|
|
"//third_party/blink/renderer/core/url/url.idl",
|
|
"//third_party/blink/renderer/core/url/url_search_params.idl",
|
|
"//third_party/blink/renderer/core/url_pattern/url_pattern.idl",
|
|
]
|
|
modules_idl_files = [
|
|
"//third_party/blink/renderer/modules/compression/compression_stream.idl",
|
|
"//third_party/blink/renderer/modules/compression/decompression_stream.idl",
|
|
"//third_party/blink/renderer/modules/encoding/text_decoder.idl",
|
|
"//third_party/blink/renderer/modules/encoding/text_decoder_stream.idl",
|
|
"//third_party/blink/renderer/modules/encoding/text_encoder.idl",
|
|
"//third_party/blink/renderer/modules/encoding/text_encoder_stream.idl",
|
|
]
|
|
idl_file = "shell/renderer/preload_realm_global_scope.idl"
|
|
runtime_enabled_features =
|
|
"//third_party/blink/renderer/platform/runtime_enabled_features.json5"
|
|
wrapper_type_info_header =
|
|
"//third_party/blink/renderer/platform/bindings/wrapper_type_info.h"
|
|
|
|
inputs = [
|
|
idl_file,
|
|
runtime_enabled_features,
|
|
wrapper_type_info_header,
|
|
] + core_idl_files + modules_idl_files
|
|
|
|
# Read Blink's own .pydeps files directly instead of using action_with_pydeps
|
|
# (which expects a checked-in build/generate_preload_realm_bindings.pydeps)
|
|
# so we automatically pick up upstream Blink bindings script changes on rolls
|
|
# without manually maintaining a duplicate .pydeps file in //electron.
|
|
_blink_scripts_dir = "//third_party/blink/renderer/bindings/scripts"
|
|
_pydeps_files = [
|
|
"$_blink_scripts_dir/collect_idl_files.pydeps",
|
|
"$_blink_scripts_dir/generate_bindings.pydeps",
|
|
]
|
|
_pydeps_lines = []
|
|
foreach(_pydeps_file, _pydeps_files) {
|
|
_pydeps_lines += read_file(_pydeps_file, "list lines")
|
|
}
|
|
_pydeps_entries = filter_exclude(_pydeps_lines, [ "#*" ])
|
|
inputs +=
|
|
rebase_path(_pydeps_entries, ".", _blink_scripts_dir) + _pydeps_files
|
|
|
|
outputs = [
|
|
"$target_gen_dir/preload_realm/v8_preload_realm_global_scope.cc",
|
|
"$target_gen_dir/preload_realm/v8_preload_realm_global_scope.h",
|
|
]
|
|
|
|
args =
|
|
[
|
|
"--root-src-dir",
|
|
rebase_path("//", root_build_dir),
|
|
"--root-gen-dir",
|
|
rebase_path(root_gen_dir, root_build_dir),
|
|
"--output-reldir",
|
|
rebase_path("$target_gen_dir/preload_realm", root_gen_dir),
|
|
"--idl-file",
|
|
rebase_path(idl_file, root_build_dir),
|
|
"--runtime-enabled-features",
|
|
rebase_path(runtime_enabled_features, root_build_dir),
|
|
"--wrapper-type-info-header",
|
|
rebase_path(wrapper_type_info_header, root_build_dir),
|
|
"--core-idl-files",
|
|
] + rebase_path(core_idl_files, root_build_dir) +
|
|
[ "--modules-idl-files" ] + rebase_path(modules_idl_files, root_build_dir)
|
|
}
|
|
|
|
source_set("electron_lib") {
|
|
configs += [
|
|
"//v8:external_startup_data",
|
|
"//third_party/electron_node:node_external_config",
|
|
]
|
|
|
|
public_configs = [
|
|
":branding",
|
|
":electron_lib_config",
|
|
]
|
|
|
|
deps = [
|
|
":electron_fuses",
|
|
":electron_generate_node_defines",
|
|
":electron_generate_preload_realm_bindings",
|
|
":electron_js2c",
|
|
":electron_version_header",
|
|
":resources",
|
|
"buildflags",
|
|
"chromium_src:chrome",
|
|
"chromium_src:chrome_spellchecker",
|
|
"shell/common:mojo",
|
|
"shell/common:plugin",
|
|
"shell/common:web_contents_utility",
|
|
"shell/services/node/public/mojom",
|
|
"//base:base_static",
|
|
"//base/allocator:buildflags",
|
|
"//build/util:chromium_git_revision",
|
|
"//chrome:strings",
|
|
"//chrome/app:command_ids",
|
|
"//chrome/app/resources:platform_locale_settings",
|
|
"//chrome/common/notifications",
|
|
"//components/cbor",
|
|
"//components/cdm/renderer",
|
|
"//components/certificate_transparency",
|
|
"//components/compose:buildflags",
|
|
"//components/embedder_support:user_agent",
|
|
"//components/input",
|
|
"//components/language/core/browser",
|
|
"//components/memory_system",
|
|
"//components/net_log",
|
|
"//components/network_hints/browser",
|
|
"//components/network_hints/common:mojo_bindings",
|
|
"//components/network_hints/renderer",
|
|
"//components/network_session_configurator/common",
|
|
"//components/omnibox/browser:buildflags",
|
|
"//components/os_crypt/async/browser",
|
|
"//components/os_crypt/async/browser:key_provider_interface",
|
|
"//components/pref_registry",
|
|
"//components/prefs",
|
|
"//components/security_state/content",
|
|
"//components/tracing:tracing_metrics",
|
|
"//components/upload_list",
|
|
"//components/user_prefs",
|
|
"//components/viz/host",
|
|
"//components/viz/service",
|
|
"//components/webrtc",
|
|
"//content/public/browser",
|
|
"//content/public/child",
|
|
"//content/public/gpu",
|
|
"//content/public/renderer",
|
|
"//content/public/utility",
|
|
"//device/bluetooth",
|
|
"//device/bluetooth/public/cpp",
|
|
"//device/fido",
|
|
"//device/fido/strings",
|
|
"//gin",
|
|
"//gpu/ipc/client",
|
|
"//media/capture/mojom:video_capture",
|
|
"//media/cdm:cdm_paths",
|
|
"//media/mojo/mojom",
|
|
"//media/mojo/mojom:web_speech_recognition",
|
|
"//net:extras",
|
|
"//net:net_resources",
|
|
"//printing/buildflags",
|
|
"//services/device/public/cpp/bluetooth",
|
|
"//services/device/public/cpp/geolocation",
|
|
"//services/device/public/cpp/hid",
|
|
"//services/device/public/mojom",
|
|
"//services/proxy_resolver:lib",
|
|
"//services/tracing/public/cpp",
|
|
"//services/video_capture/public/mojom:constants",
|
|
"//services/viz/privileged/mojom/compositing",
|
|
"//services/viz/public/mojom",
|
|
"//skia",
|
|
"//third_party/blink/public:blink",
|
|
"//third_party/blink/public:blink_devtools_inspector_resources",
|
|
"//third_party/boringssl",
|
|
"//third_party/electron_node:libnode",
|
|
|
|
# Provides the strong SnapshotBuilder::GetEmbeddedSnapshotData() (the
|
|
# embedded Node startup snapshot) that overrides libnode's weak no-snapshot
|
|
# stub. Lets the browser process boot Node from a snapshot.
|
|
"//third_party/electron_node:node_snapshot",
|
|
"//third_party/highway:libhwy",
|
|
"//third_party/inspector_protocol:crdtp",
|
|
"//third_party/leveldatabase",
|
|
"//third_party/libyuv",
|
|
"//third_party/perfetto/protos/perfetto/config:cpp",
|
|
"//third_party/webrtc_overrides:webrtc_component",
|
|
"//third_party/widevine/cdm:headers",
|
|
"//third_party/zlib/google:zip",
|
|
"//tools/v8_context_snapshot:buildflags",
|
|
"//ui/base:ozone_buildflags",
|
|
"//ui/base/idle",
|
|
"//ui/compositor",
|
|
"//ui/events:dom_keycode_converter",
|
|
"//ui/gl",
|
|
"//ui/native_theme",
|
|
"//ui/shell_dialogs",
|
|
"//ui/views",
|
|
"//ui/views/controls/webview",
|
|
"//v8",
|
|
"//v8:v8_libplatform",
|
|
]
|
|
|
|
if (v8_use_external_startup_data && use_v8_context_snapshot &&
|
|
current_toolchain == default_toolchain) {
|
|
deps += [ ":mksnapshot_checksum_gen" ]
|
|
}
|
|
|
|
public_deps = [
|
|
"//base",
|
|
"//base:i18n",
|
|
"//build/config/compiler:compiler_buildflags",
|
|
"//content/public/app",
|
|
"//ui/base/unowned_user_data",
|
|
]
|
|
|
|
include_dirs = [
|
|
".",
|
|
"$target_gen_dir",
|
|
|
|
# TODO(nornagon): replace usage of SchemeRegistry by an actually exported
|
|
# API of blink, then remove this from the include_dirs.
|
|
"//third_party/blink/renderer",
|
|
]
|
|
|
|
defines = [
|
|
"BLINK_MOJO_IMPL=1",
|
|
"V8_DEPRECATION_WARNINGS",
|
|
]
|
|
libs = []
|
|
|
|
if (is_linux) {
|
|
defines += [ "GDK_DISABLE_DEPRECATION_WARNINGS" ]
|
|
}
|
|
|
|
if (!is_mas_build) {
|
|
deps += [
|
|
"//components/crash/core/app",
|
|
"//components/crash/core/browser",
|
|
]
|
|
}
|
|
|
|
deps += [ "//electron/build/config:generate_mas_config" ]
|
|
|
|
sources = filenames.lib_sources +
|
|
get_target_outputs(":electron_generate_preload_realm_bindings")
|
|
if (is_win) {
|
|
sources += filenames.lib_sources_win
|
|
}
|
|
if (is_mac) {
|
|
sources += filenames.lib_sources_mac
|
|
}
|
|
if (is_posix) {
|
|
sources += filenames.lib_sources_posix
|
|
}
|
|
if (is_linux) {
|
|
sources += filenames.lib_sources_linux
|
|
}
|
|
if (!is_mac) {
|
|
sources += filenames.lib_sources_views
|
|
}
|
|
if (is_debug || dcheck_always_on) {
|
|
sources += [ "shell/common/api/electron_api_testing.cc" ]
|
|
deps += [ "shell/common:v8_code_cache_test_helpers" ]
|
|
}
|
|
|
|
if (electron_generate_js2c_code_cache) {
|
|
sources += [
|
|
"$root_gen_dir/electron_natives_code_cache_browser.cc",
|
|
"$root_gen_dir/electron_natives_code_cache_renderer.cc",
|
|
"$root_gen_dir/electron_natives_code_cache_sandbox.cc",
|
|
"$root_gen_dir/electron_natives_code_cache_utility.cc",
|
|
"$root_gen_dir/electron_natives_code_cache_worker.cc",
|
|
]
|
|
deps += [ ":run_electron_natives_codecache" ]
|
|
} else {
|
|
sources += [ "shell/common/node_natives_code_cache_stub.cc" ]
|
|
}
|
|
|
|
if (is_component_build) {
|
|
defines += [ "NODE_SHARED_MODE" ]
|
|
}
|
|
|
|
if (enable_prompt_api) {
|
|
sources += [
|
|
"shell/browser/ai/proxying_ai_manager.cc",
|
|
"shell/browser/ai/proxying_ai_manager.h",
|
|
"shell/utility/ai/utility_ai_language_model.cc",
|
|
"shell/utility/ai/utility_ai_language_model.h",
|
|
"shell/utility/ai/utility_ai_manager.cc",
|
|
"shell/utility/ai/utility_ai_manager.h",
|
|
]
|
|
}
|
|
|
|
if (is_mac) {
|
|
deps += [
|
|
"shell/common:app_shim",
|
|
"//components/os_crypt/async/browser:keychain_key_provider",
|
|
"//components/os_crypt/common:keychain_password_mac",
|
|
"//components/remote_cocoa/app_shim",
|
|
"//components/remote_cocoa/browser",
|
|
"//content/browser:mac_helpers",
|
|
"//mojo/core/embedder",
|
|
"//mojo/public/cpp/platform",
|
|
"//ui/accelerated_widget_mac",
|
|
]
|
|
|
|
if (!is_mas_build) {
|
|
deps += [ "//third_party/crashpad/crashpad/client" ]
|
|
}
|
|
|
|
frameworks = [
|
|
"AuthenticationServices.framework",
|
|
"AVFoundation.framework",
|
|
"Carbon.framework",
|
|
"LocalAuthentication.framework",
|
|
"QuartzCore.framework",
|
|
"Quartz.framework",
|
|
"Security.framework",
|
|
"SecurityInterface.framework",
|
|
"ServiceManagement.framework",
|
|
"StoreKit.framework",
|
|
"UserNotifications.framework",
|
|
]
|
|
|
|
weak_frameworks = [ "QuickLookThumbnailing.framework" ]
|
|
|
|
sources += [
|
|
"shell/browser/ui/views/autofill_popup_view.cc",
|
|
"shell/browser/ui/views/autofill_popup_view.h",
|
|
]
|
|
if (is_mas_build) {
|
|
sources += [ "shell/browser/api/electron_api_app_mas.mm" ]
|
|
sources -= [ "shell/browser/auto_updater_mac.mm" ]
|
|
sources -= [
|
|
"shell/app/electron_crash_reporter_client.cc",
|
|
"shell/app/electron_crash_reporter_client.h",
|
|
"shell/common/crash_keys.cc",
|
|
"shell/common/crash_keys.h",
|
|
]
|
|
} else {
|
|
frameworks += [
|
|
"Squirrel.framework",
|
|
"ReactiveObjC.framework",
|
|
"Mantle.framework",
|
|
]
|
|
|
|
deps += [
|
|
"//third_party/squirrel.mac:reactiveobjc_framework+link",
|
|
"//third_party/squirrel.mac:squirrel_framework+link",
|
|
]
|
|
|
|
# ReactiveObjC which is used by Squirrel requires using __weak.
|
|
cflags_objcc = [ "-fobjc-weak" ]
|
|
}
|
|
}
|
|
if (is_linux) {
|
|
libs = [ "xshmfence" ]
|
|
deps += [
|
|
":electron_gtk_stubs",
|
|
":libnotify_loader",
|
|
"//build/config/linux/gtk",
|
|
"//components/crash/content/browser",
|
|
"//components/os_crypt/async/browser:freedesktop_secret_key_provider",
|
|
"//components/os_crypt/async/browser:posix_key_provider",
|
|
"//components/os_crypt/async/browser:secret_portal_key_provider",
|
|
"//dbus",
|
|
"//device/bluetooth",
|
|
"//third_party/crashpad/crashpad/client",
|
|
"//ui/base/ime/linux",
|
|
"//ui/events/devices/x11",
|
|
"//ui/events/platform/x11",
|
|
"//ui/gtk:gtk_config",
|
|
"//ui/linux:display_server_utils",
|
|
"//ui/linux:linux_ui",
|
|
"//ui/linux:linux_ui_factory",
|
|
"//ui/wm",
|
|
]
|
|
if (ozone_platform_x11) {
|
|
sources += filenames.lib_sources_linux_x11
|
|
public_deps += [
|
|
"//ui/base/x",
|
|
"//ui/ozone/platform/x11",
|
|
]
|
|
}
|
|
configs += [ ":gio_unix" ]
|
|
defines += [
|
|
# Disable warnings for g_settings_list_schemas.
|
|
"GLIB_DISABLE_DEPRECATION_WARNINGS",
|
|
]
|
|
|
|
sources += [
|
|
"shell/browser/certificate_manager_model.cc",
|
|
"shell/browser/certificate_manager_model.h",
|
|
"shell/browser/linux/x11_util.cc",
|
|
"shell/browser/linux/x11_util.h",
|
|
"shell/browser/ui/gtk_util.cc",
|
|
"shell/browser/ui/gtk_util.h",
|
|
]
|
|
}
|
|
if (is_win) {
|
|
libs += [
|
|
"cryptui.lib",
|
|
"dwmapi.lib",
|
|
]
|
|
sources += [ "shell/common/asar/archive_win.cc" ]
|
|
deps += [
|
|
"//components/app_launch_prefetch",
|
|
"//components/crash/core/app:crash_export_thunks",
|
|
"//components/os_crypt/async/browser:dpapi_key_provider",
|
|
"//third_party/libxml:xml_writer",
|
|
"//ui/color:accent_color_observer",
|
|
"//ui/wm",
|
|
"//ui/wm/public",
|
|
]
|
|
public_deps += [
|
|
"//sandbox/win:sandbox",
|
|
"//third_party/crashpad/crashpad/handler",
|
|
]
|
|
}
|
|
|
|
if (enable_plugins) {
|
|
sources += [
|
|
"shell/browser/electron_plugin_info_host_impl.cc",
|
|
"shell/browser/electron_plugin_info_host_impl.h",
|
|
"shell/common/plugin_info.cc",
|
|
"shell/common/plugin_info.h",
|
|
]
|
|
}
|
|
|
|
if (enable_printing) {
|
|
sources += [
|
|
"shell/browser/printing/print_to_pdf.cc",
|
|
"shell/browser/printing/print_to_pdf.h",
|
|
"shell/browser/printing/print_view_manager_electron.cc",
|
|
"shell/browser/printing/print_view_manager_electron.h",
|
|
"shell/browser/printing/printing_utils.cc",
|
|
"shell/browser/printing/printing_utils.h",
|
|
"shell/renderer/printing/print_render_frame_helper_delegate.cc",
|
|
"shell/renderer/printing/print_render_frame_helper_delegate.h",
|
|
]
|
|
deps += [
|
|
"//chrome/services/printing/public/mojom",
|
|
"//components/printing/common:mojo_interfaces",
|
|
]
|
|
if (is_mac) {
|
|
deps += [ "//chrome/services/mac_notifications/public/mojom" ]
|
|
}
|
|
}
|
|
|
|
if (enable_electron_extensions) {
|
|
sources += filenames.lib_sources_extensions
|
|
deps += [
|
|
"shell/browser/extensions/api:api_registration",
|
|
"shell/common/extensions/api",
|
|
"shell/common/extensions/api:extensions_features",
|
|
"//chrome/browser/resources:component_extension_resources",
|
|
"//components/guest_view/common:mojom",
|
|
"//components/update_client",
|
|
"//components/zoom",
|
|
"//extensions/browser",
|
|
"//extensions/browser/api:api_provider",
|
|
"//extensions/browser/mime_handler",
|
|
"//extensions/browser/updater",
|
|
"//extensions/common",
|
|
"//extensions/common:core_api_provider",
|
|
"//extensions/renderer",
|
|
]
|
|
}
|
|
|
|
if (enable_pdf) {
|
|
# Printing depends on some //pdf code, so it needs to be built even if the
|
|
# pdf viewer isn't enabled.
|
|
deps += [
|
|
"//pdf",
|
|
"//pdf:features",
|
|
]
|
|
}
|
|
if (enable_pdf_viewer) {
|
|
deps += [
|
|
"//chrome/browser/resources/pdf:resources",
|
|
"//chrome/browser/ui:browser_element_identifiers",
|
|
"//components/pdf/browser",
|
|
"//components/pdf/browser:interceptors",
|
|
"//components/pdf/common:constants",
|
|
"//components/pdf/common:util",
|
|
"//components/pdf/renderer",
|
|
"//components/user_education/webui",
|
|
"//pdf",
|
|
"//pdf:content_restriction",
|
|
]
|
|
sources += [
|
|
"shell/browser/electron_pdf_document_helper_client.cc",
|
|
"shell/browser/electron_pdf_document_helper_client.h",
|
|
"shell/browser/extensions/api/pdf_viewer_private/pdf_viewer_private_api.cc",
|
|
"shell/browser/extensions/api/pdf_viewer_private/pdf_viewer_private_api.h",
|
|
]
|
|
}
|
|
|
|
sources += get_target_outputs(":electron_fuses")
|
|
}
|
|
|
|
# Host tool that emits a V8 code cache for a JS file, keyed to whichever V8
|
|
# startup snapshot blob it is given -- including one from another OS/CPU's
|
|
# build of the same Electron version. See shell/common/electron_xcache_main.cc.
|
|
if (current_toolchain == default_toolchain) {
|
|
executable("electron_xcache") {
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
include_dirs = [ "//" ]
|
|
sources = [ "shell/common/electron_xcache_main.cc" ]
|
|
deps = [
|
|
"//third_party/zlib",
|
|
"//v8",
|
|
"//v8:v8_libplatform",
|
|
]
|
|
}
|
|
}
|
|
|
|
# Build-time host tool emitting V8 code caches for the internal/electron/js2c/*
|
|
# framework bundles. Built in v8_snapshot_toolchain (like node_mksnapshot) so it
|
|
# links V8 with V8_TARGET_ARCH set to the target and reads the target's snapshot
|
|
# blob -- the cache it emits is keyed to the target's read-only checksum and
|
|
# flag hash. Cross-OS stays off; see electron_generate_js2c_code_cache.
|
|
if (electron_generate_js2c_code_cache) {
|
|
if (current_toolchain == v8_snapshot_toolchain) {
|
|
executable("electron_natives_codecache") {
|
|
# Host build tool, not shipped Chromium code.
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
include_dirs = [
|
|
".",
|
|
"//",
|
|
]
|
|
sources = [ "shell/common/electron_natives_codecache_main.cc" ]
|
|
|
|
# node's zstd binding also needs the compression symbols.
|
|
deps = [
|
|
"//third_party/electron_node:libnode",
|
|
|
|
# libnode no longer carries the GetEmbeddedSnapshotData stub; this
|
|
# (non-browser-flavor) tool builds caches against the v8 context
|
|
# snapshot, not the embedded Node snapshot, so it links the stub.
|
|
"//third_party/electron_node:node_snapshot_stub",
|
|
"//third_party/zstd:compress",
|
|
]
|
|
}
|
|
|
|
# The browser process boots from the embedded Node startup snapshot, whose
|
|
# read-only heap (and thus the code-cache read-only checksum) is owned
|
|
# uniquely by the SnapshotCreator-produced blob -- matching no standalone
|
|
# snapshot file. This variant links the real node_snapshot so it builds the
|
|
# browser bundles' cache against that exact snapshot's isolate (via
|
|
# GetEmbeddedSnapshotData + InitializeIsolateParams in the tool), the only
|
|
# isolate whose read-only checksum matches the runtime browser process.
|
|
if (node_use_node_snapshot) {
|
|
executable("electron_natives_codecache_snapshot") {
|
|
# Host build tool, not shipped Chromium code.
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
include_dirs = [
|
|
".",
|
|
"//",
|
|
]
|
|
sources = [ "shell/common/electron_natives_codecache_main.cc" ]
|
|
deps = [
|
|
"//third_party/electron_node:libnode",
|
|
"//third_party/electron_node:node_snapshot",
|
|
"//third_party/zstd:compress",
|
|
]
|
|
}
|
|
}
|
|
}
|
|
|
|
# One generated cache per process flavor: V8's code-cache key includes
|
|
# FlagList::Hash() over non-default flags, which differs per process type.
|
|
# The flag deltas below were captured from live processes.
|
|
# `node_builtins`: whether the flavor also carries a cache for Node's own
|
|
# builtins, i.e. whether its processes bootstrap their Node.js environment
|
|
# from scratch on this build instead of deserializing it from the embedded
|
|
# Node startup snapshot (~6.5 MB per flavor, so only where it is consumed).
|
|
# Renderer / web-worker environments always bootstrap from scratch; the node
|
|
# service's utility process only on builds without a Node snapshot; the
|
|
# sandboxed renderer has no Node environment and no process type consumes the
|
|
# worker flavor for one.
|
|
_js2c_cc_flavors = [
|
|
{
|
|
name = "sandbox" # sandboxed renderer (no Node env)
|
|
flags = "--enable-sharedarraybuffer-per-context"
|
|
node_builtins = false
|
|
},
|
|
{
|
|
name = "renderer"
|
|
flags = "--enable-sharedarraybuffer-per-context --rehash-snapshot " +
|
|
"--no-freeze-flags-after-init"
|
|
node_builtins = true
|
|
},
|
|
{
|
|
name = "utility"
|
|
flags = "--rehash-snapshot --no-freeze-flags-after-init"
|
|
node_builtins = !node_use_node_snapshot
|
|
},
|
|
{
|
|
name = "worker"
|
|
flags = "--rehash-snapshot --no-freeze-flags-after-init"
|
|
node_builtins = false
|
|
},
|
|
]
|
|
|
|
# The browser flavor is special-cased below when a Node startup snapshot is
|
|
# embedded: its isolate (and so its code-cache read-only checksum) comes from
|
|
# that snapshot, not the v8 context snapshot. Without a snapshot it boots from
|
|
# the v8 context snapshot like the rest, and bootstraps Node from scratch.
|
|
if (!node_use_node_snapshot) {
|
|
_js2c_cc_flavors += [
|
|
{
|
|
name = "browser"
|
|
flags = "--rehash-snapshot --no-freeze-flags-after-init"
|
|
node_builtins = true
|
|
},
|
|
]
|
|
}
|
|
|
|
foreach(_f, _js2c_cc_flavors) {
|
|
action("run_electron_natives_codecache_" + _f.name) {
|
|
deps = [
|
|
":electron_natives_codecache($v8_snapshot_toolchain)",
|
|
"//tools/v8_context_snapshot",
|
|
"//v8:run_mksnapshot_default",
|
|
]
|
|
script = "//v8/tools/run.py"
|
|
_gen_dir =
|
|
get_label_info(":electron_natives_codecache($v8_snapshot_toolchain)",
|
|
"root_out_dir")
|
|
_out = "$root_gen_dir/electron_natives_code_cache_" + _f.name + ".cc"
|
|
outputs = [ _out ]
|
|
args = [
|
|
"./" + rebase_path(_gen_dir + "/electron_natives_codecache",
|
|
root_build_dir),
|
|
rebase_path(_out, root_build_dir),
|
|
rebase_path("$root_out_dir/$v8_context_snapshot_filename",
|
|
root_build_dir),
|
|
_f.name,
|
|
_f.flags,
|
|
]
|
|
if (_f.node_builtins) {
|
|
args += [ "1" ]
|
|
} else {
|
|
args += [ "0" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
# Browser flavor, built against the embedded Node startup snapshot so its
|
|
# code-cache read-only checksum matches the runtime browser isolate.
|
|
if (node_use_node_snapshot) {
|
|
action("run_electron_natives_codecache_browser") {
|
|
deps = [
|
|
":electron_natives_codecache_snapshot($v8_snapshot_toolchain)",
|
|
"//v8:run_mksnapshot_default",
|
|
]
|
|
script = "//v8/tools/run.py"
|
|
_gen_dir = get_label_info(
|
|
":electron_natives_codecache_snapshot($v8_snapshot_toolchain)",
|
|
"root_out_dir")
|
|
_out = "$root_gen_dir/electron_natives_code_cache_browser.cc"
|
|
outputs = [ _out ]
|
|
args = [
|
|
"./" + rebase_path(_gen_dir + "/electron_natives_codecache_snapshot",
|
|
root_build_dir),
|
|
rebase_path(_out, root_build_dir),
|
|
|
|
# Base blob for V8's global init; the isolate itself is created from the
|
|
# embedded snapshot, which overrides this (the tool ignores it when the
|
|
# real node_snapshot is linked).
|
|
rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir),
|
|
"browser",
|
|
"--rehash-snapshot --no-freeze-flags-after-init",
|
|
|
|
# Processes created from the Node snapshot deserialize Node's builtins'
|
|
# code cache from it.
|
|
"0",
|
|
]
|
|
}
|
|
}
|
|
|
|
group("run_electron_natives_codecache") {
|
|
public_deps = []
|
|
foreach(_f, _js2c_cc_flavors) {
|
|
public_deps += [ ":run_electron_natives_codecache_" + _f.name ]
|
|
}
|
|
if (node_use_node_snapshot) {
|
|
public_deps += [ ":run_electron_natives_codecache_browser" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
# tools/v8_context_snapshot writes its output to $root_build_dir regardless
|
|
# of toolchain, so this is only well-formed in the default toolchain (where
|
|
# $root_out_dir == $root_build_dir). It is also only needed there -- only the
|
|
# shipped framework reads snapshot_checksum.h.
|
|
if (current_toolchain == default_toolchain) {
|
|
action("mksnapshot_checksum_gen") {
|
|
script = "build/checksum_header.py"
|
|
|
|
outputs = [ "$target_gen_dir/snapshot_checksum.h" ]
|
|
inputs = [ "$root_out_dir/$v8_context_snapshot_filename" ]
|
|
args = rebase_path(inputs)
|
|
|
|
args += rebase_path(outputs)
|
|
|
|
deps = [ "//tools/v8_context_snapshot" ]
|
|
}
|
|
}
|
|
|
|
# Resource allowlisting (slimmed locale paks + the completeness check) is
|
|
# wired up for Linux and macOS: Windows still needs PDB-based extraction.
|
|
electron_use_resource_allowlist =
|
|
enable_resource_allowlist_generation && (is_linux || is_mac)
|
|
|
|
if (electron_use_resource_allowlist) {
|
|
# The list of grit resource IDs actually referenced by the link inputs of
|
|
# the electron executable (the Electron Framework on macOS), extracted from
|
|
# the ui::AllowlistedResource<id> markers that --allowlist-support plants at
|
|
# every resource-macro use. Used to repack only reachable strings into the
|
|
# locale .pak files.
|
|
electron_resource_allowlist_file =
|
|
"$target_gen_dir/electron_resource_allowlist.txt"
|
|
|
|
# On macOS this target is defined with the framework below.
|
|
if (!is_mac) {
|
|
# TODO: on Windows this should extract from electron.exe.pdb instead of the
|
|
# inputs pseudo-link (and the executable must then stop depending on
|
|
# :packed_resources to avoid a dependency cycle).
|
|
generate_resource_allowlist("electron_resource_allowlist") {
|
|
deps = [ ":electron_resource_allowlist_inputs" ]
|
|
inputs = [
|
|
"$root_out_dir/libelectron_resource_allowlist_inputs$shlib_extension",
|
|
]
|
|
output = electron_resource_allowlist_file
|
|
}
|
|
}
|
|
}
|
|
|
|
electron_paks("packed_resources") {
|
|
if (is_mac) {
|
|
output_dir = "$root_gen_dir/electron_repack"
|
|
copy_data_to_bundle = true
|
|
} else {
|
|
output_dir = root_out_dir
|
|
}
|
|
if (electron_use_resource_allowlist) {
|
|
# locale_deps rather than deps: only the locale repacks consume the
|
|
# allowlist, so the other .pak repacks need not wait for it (it is
|
|
# derived from the binary's link inputs, i.e. all native compilation).
|
|
locale_allowlist = electron_resource_allowlist_file
|
|
locale_deps = [ ":electron_resource_allowlist" ]
|
|
}
|
|
}
|
|
|
|
if (electron_use_resource_allowlist) {
|
|
# Asserts that every grit resource the binary can request is present in one
|
|
# of the shipped .pak files, so a missing string/.grd fails the build
|
|
# instead of rendering as an empty string at runtime.
|
|
action("electron_resource_allowlist_check") {
|
|
script = "build/check_resource_allowlist.py"
|
|
deps = [
|
|
":electron_resource_allowlist",
|
|
":packed_resources",
|
|
]
|
|
if (is_mac) {
|
|
# Matches the output_dir of :packed_resources above and the Apple
|
|
# locale output naming of repack_locales() (en-US is repacked as en.pak
|
|
# and ships in the bundle as en.lproj/locale.pak).
|
|
_packed_resources_dir = "$root_gen_dir/electron_repack"
|
|
_reference_locale = "en"
|
|
} else {
|
|
_packed_resources_dir = root_out_dir
|
|
_reference_locale = "en-US"
|
|
}
|
|
_shipped_paks = [
|
|
"$_packed_resources_dir/resources.pak",
|
|
"$_packed_resources_dir/chrome_100_percent.pak",
|
|
"$_packed_resources_dir/locales/$_reference_locale.pak",
|
|
]
|
|
if (enable_hidpi) {
|
|
_shipped_paks += [ "$_packed_resources_dir/chrome_200_percent.pak" ]
|
|
}
|
|
inputs = [
|
|
electron_resource_allowlist_file,
|
|
"build/resource_allowlist_check_suppressions.txt",
|
|
] + _shipped_paks
|
|
outputs = [ "$target_gen_dir/electron_resource_allowlist_check.stamp" ]
|
|
args = [
|
|
"--allowlist",
|
|
rebase_path(electron_resource_allowlist_file, root_build_dir),
|
|
"--gen-dir",
|
|
rebase_path(root_gen_dir, root_build_dir),
|
|
"--grit-dir",
|
|
rebase_path("//tools/grit", root_build_dir),
|
|
"--suppressions",
|
|
rebase_path("build/resource_allowlist_check_suppressions.txt",
|
|
root_build_dir),
|
|
"--stamp",
|
|
rebase_path(outputs[0], root_build_dir),
|
|
]
|
|
foreach(pak, _shipped_paks) {
|
|
args += [
|
|
"--pak",
|
|
rebase_path(pak, root_build_dir),
|
|
]
|
|
}
|
|
}
|
|
}
|
|
|
|
if (is_mac) {
|
|
electron_framework_name = "$electron_product_name Framework"
|
|
electron_helper_name = "$electron_product_name Helper"
|
|
electron_login_helper_name = "$electron_product_name Login Helper"
|
|
electron_framework_version = "A"
|
|
|
|
mac_xib_bundle_data("electron_xibs") {
|
|
sources = [ "shell/common/resources/mac/MainMenu.xib" ]
|
|
}
|
|
|
|
bundle_data("electron_framework_resources") {
|
|
public_deps = [ ":packed_resources" ]
|
|
sources = []
|
|
if (icu_use_data_file) {
|
|
sources += [ "$root_out_dir/icudtl.dat" ]
|
|
public_deps += [ "//third_party/icu:icudata" ]
|
|
}
|
|
if (v8_use_external_startup_data) {
|
|
public_deps += [ "//v8" ]
|
|
if (use_v8_context_snapshot) {
|
|
sources += [ "$root_out_dir/$v8_context_snapshot_filename" ]
|
|
public_deps += [ "//tools/v8_context_snapshot" ]
|
|
} else {
|
|
sources += [ "$root_out_dir/snapshot_blob.bin" ]
|
|
}
|
|
}
|
|
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
|
|
}
|
|
|
|
if (!is_component_build && is_component_ffmpeg) {
|
|
bundle_data("electron_framework_libraries") {
|
|
sources = []
|
|
public_deps = []
|
|
sources += [ "$root_out_dir/libffmpeg.dylib" ]
|
|
public_deps += [ "//third_party/ffmpeg" ]
|
|
outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
|
|
}
|
|
} else {
|
|
group("electron_framework_libraries") {
|
|
}
|
|
}
|
|
|
|
# Add the SwiftShader .dylibs in the Libraries directory of the Framework.
|
|
bundle_data("electron_swiftshader_binaries") {
|
|
sources = [
|
|
"$root_out_dir/vk_intermediates/libvk_swiftshader.dylib",
|
|
"$root_out_dir/vk_intermediates/vk_swiftshader_icd.json",
|
|
]
|
|
outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
|
|
public_deps = [ "//ui/gl:swiftshader_vk_library_copy" ]
|
|
}
|
|
|
|
group("electron_swiftshader_library") {
|
|
deps = [ ":electron_swiftshader_binaries" ]
|
|
}
|
|
|
|
# The executable of an app shim. Apps copy it into the shim bundles they make;
|
|
# it links nothing from Electron and loads the host app's framework.
|
|
executable("electron_app_shim_loader") {
|
|
output_name = "app_shim_loader"
|
|
sources = [ "shell/app_shim/app_shim_loader_mac.mm" ]
|
|
frameworks = [ "Cocoa.framework" ]
|
|
}
|
|
|
|
bundle_data("electron_app_shim_loader_bundle_data") {
|
|
sources = [ "$root_out_dir/app_shim_loader" ]
|
|
outputs = [ "{{bundle_contents_dir}}/Helpers/{{source_file_part}}" ]
|
|
public_deps = [ ":electron_app_shim_loader" ]
|
|
}
|
|
|
|
bundle_data("electron_crashpad_helper") {
|
|
sources = [ "$root_out_dir/chrome_crashpad_handler" ]
|
|
|
|
outputs = [ "{{bundle_contents_dir}}/Helpers/{{source_file_part}}" ]
|
|
|
|
public_deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
|
|
|
|
if (is_asan) {
|
|
# crashpad_handler requires the ASan runtime at its @executable_path.
|
|
sources += [ "$root_out_dir/libclang_rt.asan_osx_dynamic.dylib" ]
|
|
public_deps += [ "//build/config/sanitizers:copy_sanitizer_runtime" ]
|
|
}
|
|
}
|
|
|
|
if (electron_use_resource_allowlist) {
|
|
# Read the markers back from the linked framework's symbol table (the
|
|
# dSYM's copy when the framework itself is stripped). The locale paks that
|
|
# consume this reach the framework through bundle_deps, not the link, so
|
|
# there is no cycle.
|
|
if (enable_dsyms) {
|
|
_allowlist_binary = "$root_out_dir/$electron_framework_name.dSYM/Contents/Resources/DWARF/$electron_framework_name"
|
|
} else if (save_unstripped_output) {
|
|
_allowlist_binary = "$root_out_dir/$electron_framework_name.unstripped"
|
|
} else {
|
|
_allowlist_binary =
|
|
get_label_info(":electron_framework_shared_library",
|
|
"target_out_dir") +
|
|
"/electron_framework_shared_library/$electron_framework_name"
|
|
}
|
|
|
|
action("electron_resource_allowlist") {
|
|
script = "build/mac_resource_allowlist.py"
|
|
deps = [ ":electron_framework+link_nested" ]
|
|
_nm = "//third_party/llvm-build/Release+Asserts/bin/llvm-nm"
|
|
inputs = [
|
|
_allowlist_binary,
|
|
_nm,
|
|
]
|
|
outputs = [ electron_resource_allowlist_file ]
|
|
args = [
|
|
"--nm",
|
|
rebase_path(_nm, root_build_dir),
|
|
"--input",
|
|
rebase_path(_allowlist_binary, root_build_dir),
|
|
"--output",
|
|
rebase_path(electron_resource_allowlist_file, root_build_dir),
|
|
]
|
|
}
|
|
}
|
|
|
|
# Link against Electron Framework without mac_framework_bundle's "+link"
|
|
# group. Its public config lists the framework bundle in `inputs`, which GN
|
|
# applies to every compile step of the consuming target, so each executable's
|
|
# objects were rebuilt (and the whole bundle uploaded to RBE) whenever the
|
|
# framework relinked. GN already makes the link step depend on the bundle.
|
|
config("electron_framework_link_config") {
|
|
visibility = [ ":electron_framework_link" ]
|
|
framework_dirs = [ root_out_dir ]
|
|
frameworks = [ "$electron_framework_name.framework" ]
|
|
}
|
|
|
|
group("electron_framework_link") {
|
|
public_deps = [ ":electron_framework" ]
|
|
public_configs = [ ":electron_framework_link_config" ]
|
|
}
|
|
|
|
mac_framework_bundle("electron_framework") {
|
|
output_name = electron_framework_name
|
|
framework_version = electron_framework_version
|
|
|
|
# Perform full ThinLTO optimization in the link step for the framework
|
|
# (where all of Chromium/Electron's code lives on macOS), matching what
|
|
# Chrome does for its framework. The default thinlto_optimize_default
|
|
# config links with --lto-O0, which skips link-time optimization entirely
|
|
# and gives up most of the benefit of ThinLTO and PGO.
|
|
configs -= [ "//build/config/compiler:thinlto_optimize_default" ]
|
|
configs += [ "//build/config/compiler:thinlto_optimize_max" ]
|
|
|
|
framework_contents = [
|
|
"Resources",
|
|
"Libraries",
|
|
]
|
|
if (!is_mas_build) {
|
|
framework_contents += [ "Helpers" ]
|
|
}
|
|
public_deps = [ ":electron_lib" ]
|
|
deps = [ "//third_party/electron_node:libnode" ]
|
|
|
|
# bundle_deps reach the bundle but not the framework's link, which
|
|
# :electron_resource_allowlist (and through it :packed_resources) depends
|
|
# on; bundle_data on the link would leak to every consumer of the paks.
|
|
bundle_deps = [
|
|
":electron_framework_libraries",
|
|
":electron_framework_resources",
|
|
":electron_swiftshader_library",
|
|
":electron_xibs",
|
|
]
|
|
if (!is_mas_build) {
|
|
bundle_deps += [
|
|
":electron_app_shim_loader_bundle_data",
|
|
":electron_crashpad_helper",
|
|
]
|
|
}
|
|
info_plist = "shell/common/resources/mac/Info.plist"
|
|
|
|
extra_substitutions = [
|
|
"ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.framework",
|
|
"ELECTRON_VERSION=$electron_version",
|
|
]
|
|
|
|
include_dirs = [ "." ]
|
|
sources = filenames.framework_sources
|
|
frameworks = [ "IOSurface.framework" ]
|
|
|
|
ldflags = [
|
|
"-Wl,-install_name,@rpath/$output_name.framework/$output_name",
|
|
"-rpath",
|
|
"@loader_path/Libraries",
|
|
|
|
# The folder this framework is in, where its sibling frameworks are. The
|
|
# app's executable has it as an rpath too, but an app shim loads this
|
|
# framework from an executable in another bundle.
|
|
"-rpath",
|
|
"@loader_path/../../..",
|
|
|
|
# Required for exporting all symbols of libuv.
|
|
"-Wl,-force_load,obj/third_party/electron_node/deps/uv/libuv.a",
|
|
]
|
|
if (is_component_build) {
|
|
ldflags += [
|
|
"-rpath",
|
|
"@executable_path/../../../../../..",
|
|
]
|
|
}
|
|
|
|
# For component ffmpeg under non-component build, it is linked from
|
|
# @loader_path. However the ffmpeg.dylib is moved to a different place
|
|
# when generating app bundle, and we should change to link from @rpath.
|
|
if (is_component_ffmpeg && !is_component_build) {
|
|
ldflags += [ "-Wcrl,installnametool,-change,@loader_path/libffmpeg.dylib,@rpath/libffmpeg.dylib" ]
|
|
}
|
|
}
|
|
|
|
template("electron_helper_app") {
|
|
mac_app_bundle(target_name) {
|
|
assert(defined(invoker.helper_name_suffix))
|
|
|
|
output_name = electron_helper_name + invoker.helper_name_suffix
|
|
deps = [
|
|
":electron_framework_link",
|
|
"//electron/build/config:generate_mas_config",
|
|
]
|
|
if (!is_mas_build) {
|
|
deps += [ "//sandbox/mac:seatbelt" ]
|
|
}
|
|
defines = [ "HELPER_EXECUTABLE" ]
|
|
sources = [
|
|
"shell/app/electron_main_mac.cc",
|
|
"shell/app/uv_stdio_fix.cc",
|
|
"shell/app/uv_stdio_fix.h",
|
|
]
|
|
include_dirs = [ "." ]
|
|
info_plist = "shell/renderer/resources/mac/Info.plist"
|
|
extra_substitutions =
|
|
[ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.helper" ]
|
|
ldflags = [
|
|
"-rpath",
|
|
"@executable_path/../../..",
|
|
]
|
|
if (is_component_build) {
|
|
ldflags += [
|
|
"-rpath",
|
|
"@executable_path/../../../../../..",
|
|
]
|
|
}
|
|
}
|
|
}
|
|
|
|
# Electron defines its own plugin helper (using CHILD_EMBEDDER_FIRST + 1) to
|
|
# allow loading of unsigned or third-party-signed libraries.
|
|
_electron_plugin_helper_params = [
|
|
"plugin",
|
|
".plugin",
|
|
" (Plugin)",
|
|
]
|
|
electron_mac_helpers =
|
|
content_mac_helpers + [ _electron_plugin_helper_params ]
|
|
|
|
foreach(helper_params, electron_mac_helpers) {
|
|
_helper_target = helper_params[0]
|
|
_helper_bundle_id = helper_params[1]
|
|
_helper_suffix = helper_params[2]
|
|
|
|
electron_helper_app("electron_helper_app_${_helper_target}") {
|
|
helper_name_suffix = _helper_suffix
|
|
}
|
|
}
|
|
|
|
template("stripped_framework") {
|
|
action(target_name) {
|
|
assert(defined(invoker.framework))
|
|
|
|
script = "//electron/build/strip_framework.py"
|
|
|
|
forward_variables_from(invoker, [ "deps" ])
|
|
inputs = [ "$root_out_dir/" + invoker.framework ]
|
|
outputs = [ "$target_out_dir/stripped_frameworks/" + invoker.framework ]
|
|
|
|
args = rebase_path(inputs) + rebase_path(outputs)
|
|
}
|
|
}
|
|
|
|
stripped_framework("stripped_mantle_framework") {
|
|
framework = "Mantle.framework"
|
|
deps = [ "//third_party/squirrel.mac:mantle_framework" ]
|
|
}
|
|
|
|
stripped_framework("stripped_reactiveobjc_framework") {
|
|
framework = "ReactiveObjC.framework"
|
|
deps = [ "//third_party/squirrel.mac:reactiveobjc_framework" ]
|
|
}
|
|
|
|
stripped_framework("stripped_squirrel_framework") {
|
|
framework = "Squirrel.framework"
|
|
deps = [ "//third_party/squirrel.mac:squirrel_framework" ]
|
|
}
|
|
|
|
bundle_data("electron_app_framework_bundle_data") {
|
|
sources = [ "$root_out_dir/$electron_framework_name.framework" ]
|
|
if (!is_mas_build) {
|
|
sources += get_target_outputs(":stripped_mantle_framework") +
|
|
get_target_outputs(":stripped_reactiveobjc_framework") +
|
|
get_target_outputs(":stripped_squirrel_framework")
|
|
}
|
|
outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ]
|
|
public_deps = [
|
|
":electron_framework_link",
|
|
":stripped_mantle_framework",
|
|
":stripped_reactiveobjc_framework",
|
|
":stripped_squirrel_framework",
|
|
]
|
|
|
|
foreach(helper_params, electron_mac_helpers) {
|
|
sources +=
|
|
[ "$root_out_dir/${electron_helper_name}${helper_params[2]}.app" ]
|
|
public_deps += [ ":electron_helper_app_${helper_params[0]}" ]
|
|
}
|
|
}
|
|
|
|
mac_app_bundle("electron_login_helper") {
|
|
output_name = electron_login_helper_name
|
|
sources = filenames.login_helper_sources
|
|
include_dirs = [ "." ]
|
|
frameworks = [ "AppKit.framework" ]
|
|
info_plist = "shell/app/resources/mac/loginhelper-Info.plist"
|
|
extra_substitutions =
|
|
[ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.loginhelper" ]
|
|
}
|
|
|
|
bundle_data("electron_login_helper_app") {
|
|
public_deps = [ ":electron_login_helper" ]
|
|
sources = [ "$root_out_dir/$electron_login_helper_name.app" ]
|
|
outputs =
|
|
[ "{{bundle_contents_dir}}/Library/LoginItems/{{source_file_part}}" ]
|
|
}
|
|
|
|
action("electron_app_lproj_dirs") {
|
|
outputs = []
|
|
|
|
foreach(locale, locales_as_apple_outputs) {
|
|
outputs += [ "$target_gen_dir/app_infoplist_strings/$locale.lproj" ]
|
|
}
|
|
script = "build/mac/make_locale_dirs.py"
|
|
args = rebase_path(outputs)
|
|
}
|
|
|
|
foreach(locale, locales_as_apple_outputs) {
|
|
bundle_data("electron_app_strings_${locale}_bundle_data") {
|
|
sources = [ "$target_gen_dir/app_infoplist_strings/$locale.lproj" ]
|
|
outputs = [ "{{bundle_resources_dir}}/$locale.lproj" ]
|
|
public_deps = [ ":electron_app_lproj_dirs" ]
|
|
}
|
|
}
|
|
|
|
group("electron_app_strings_bundle_data") {
|
|
public_deps = []
|
|
foreach(locale, locales_as_apple_outputs) {
|
|
public_deps += [ ":electron_app_strings_${locale}_bundle_data" ]
|
|
}
|
|
}
|
|
|
|
bundle_data("electron_app_resources") {
|
|
public_deps = [
|
|
":default_app_asar",
|
|
":electron_app_strings_bundle_data",
|
|
]
|
|
sources = [
|
|
"$root_out_dir/resources/default_app.asar",
|
|
"shell/browser/resources/mac/electron.icns",
|
|
]
|
|
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
|
|
}
|
|
|
|
asar_hashed_info_plist("electron_app_plist") {
|
|
keys = [ "DEFAULT_APP_ASAR_HEADER_SHA" ]
|
|
hash_targets = [ ":default_app_asar_header_hash" ]
|
|
plist_file = "shell/browser/resources/mac/Info.plist"
|
|
}
|
|
|
|
mac_app_bundle("electron_app") {
|
|
output_name = electron_product_name
|
|
sources = [
|
|
"shell/app/electron_main_mac.cc",
|
|
"shell/app/uv_stdio_fix.cc",
|
|
"shell/app/uv_stdio_fix.h",
|
|
]
|
|
include_dirs = [ "." ]
|
|
deps = [
|
|
":electron_app_framework_bundle_data",
|
|
":electron_app_plist",
|
|
":electron_app_resources",
|
|
":electron_fuses",
|
|
"//electron/build/config:generate_mas_config",
|
|
"//electron/buildflags",
|
|
]
|
|
if (is_mas_build) {
|
|
deps += [ ":electron_login_helper_app" ]
|
|
}
|
|
info_plist_target = ":electron_app_plist"
|
|
extra_substitutions = [
|
|
"ELECTRON_BUNDLE_ID=$electron_mac_bundle_id",
|
|
"ELECTRON_VERSION=$electron_version",
|
|
]
|
|
ldflags = [
|
|
"-rpath",
|
|
"@executable_path/../Frameworks",
|
|
]
|
|
}
|
|
|
|
if (enable_dsyms) {
|
|
extract_symbols("electron_framework_syms") {
|
|
binary = "$root_out_dir/$electron_framework_name.framework/Versions/$electron_framework_version/$electron_framework_name"
|
|
symbol_dir = "$root_out_dir/breakpad_symbols"
|
|
dsym_file = "$root_out_dir/$electron_framework_name.dSYM/Contents/Resources/DWARF/$electron_framework_name"
|
|
deps = [ ":electron_framework" ]
|
|
}
|
|
|
|
foreach(helper_params, electron_mac_helpers) {
|
|
_helper_target = helper_params[0]
|
|
_helper_bundle_id = helper_params[1]
|
|
_helper_suffix = helper_params[2]
|
|
|
|
extract_symbols("electron_helper_syms_${_helper_target}") {
|
|
binary = "$root_out_dir/$electron_helper_name${_helper_suffix}.app/Contents/MacOS/$electron_helper_name${_helper_suffix}"
|
|
symbol_dir = "$root_out_dir/breakpad_symbols"
|
|
dsym_file = "$root_out_dir/$electron_helper_name${_helper_suffix}.dSYM/Contents/Resources/DWARF/$electron_helper_name${_helper_suffix}"
|
|
deps = [ ":electron_helper_app_${_helper_target}" ]
|
|
}
|
|
}
|
|
|
|
extract_symbols("electron_app_syms") {
|
|
binary = "$root_out_dir/$electron_product_name.app/Contents/MacOS/$electron_product_name"
|
|
symbol_dir = "$root_out_dir/breakpad_symbols"
|
|
dsym_file = "$root_out_dir/$electron_product_name.dSYM/Contents/Resources/DWARF/$electron_product_name"
|
|
deps = [ ":electron_app" ]
|
|
}
|
|
|
|
extract_symbols("crashpad_handler_syms") {
|
|
binary = "$root_out_dir/chrome_crashpad_handler"
|
|
symbol_dir = "$root_out_dir/breakpad_symbols"
|
|
dsym_file = "$root_out_dir/chrome_crashpad_handler.dSYM/Contents/Resources/DWARF/chrome_crashpad_handler"
|
|
deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
|
|
}
|
|
|
|
group("electron_symbols") {
|
|
deps = [
|
|
":electron_app_syms",
|
|
":electron_framework_syms",
|
|
]
|
|
|
|
if (!is_mas_build) {
|
|
deps += [ ":crashpad_handler_syms" ]
|
|
}
|
|
|
|
foreach(helper_params, electron_mac_helpers) {
|
|
_helper_target = helper_params[0]
|
|
deps += [ ":electron_helper_syms_${_helper_target}" ]
|
|
}
|
|
}
|
|
} else {
|
|
group("electron_symbols") {
|
|
}
|
|
}
|
|
} else {
|
|
windows_manifest("electron_app_manifest") {
|
|
sources = [
|
|
"shell/browser/resources/win/disable_window_filtering.manifest",
|
|
"shell/browser/resources/win/dpi_aware.manifest",
|
|
as_invoker_manifest,
|
|
common_controls_manifest,
|
|
default_compatibility_manifest,
|
|
]
|
|
}
|
|
|
|
# Deps that determine the native code linked into the electron executable.
|
|
# Shared with :electron_resource_allowlist_inputs below so the resource
|
|
# allowlist is computed from exactly the same link inputs as the shipped
|
|
# binary.
|
|
electron_app_link_deps = [
|
|
":default_app_asar",
|
|
":electron_app_manifest",
|
|
":electron_lib",
|
|
":electron_win32_resources",
|
|
"//components/crash/core/app",
|
|
"//content:sandbox_helper_win",
|
|
"//electron/buildflags",
|
|
"//third_party/electron_node:libnode",
|
|
"//ui/strings",
|
|
]
|
|
|
|
if (electron_use_resource_allowlist) {
|
|
# Pseudo-link sharing the executable's link inputs: --collect-inputs-only
|
|
# makes gcc_solink_wrapper.py skip the real link and write the list of
|
|
# link inputs instead. generate_resource_allowlist greps those inputs for
|
|
# ui::AllowlistedResource<id> markers, which is the supported way to
|
|
# extract the referenced-resource set on ELF (the markers are dropped from
|
|
# the linked binary by --gc-sections and the debug strings live in .dwo
|
|
# files with use_debug_fission).
|
|
shared_library("electron_resource_allowlist_inputs") {
|
|
ldflags = [ "--collect-inputs-only" ]
|
|
deps = electron_app_link_deps
|
|
}
|
|
}
|
|
|
|
executable("electron_app") {
|
|
output_name = electron_project_name
|
|
|
|
# Perform full ThinLTO optimization in the link step for the main binary,
|
|
# matching what Chrome does for its main executable. The default
|
|
# thinlto_optimize_default config links with --lto-O0, which skips
|
|
# link-time optimization entirely and gives up most of the benefit of
|
|
# ThinLTO and PGO.
|
|
configs -= [ "//build/config/compiler:thinlto_optimize_default" ]
|
|
configs += [ "//build/config/compiler:thinlto_optimize_max" ]
|
|
|
|
if (is_win) {
|
|
sources = [ "shell/app/electron_main_win.cc" ]
|
|
} else if (is_linux) {
|
|
sources = [
|
|
"shell/app/electron_main_linux.cc",
|
|
"shell/app/environ_linux.cc",
|
|
"shell/app/uv_stdio_fix.cc",
|
|
"shell/app/uv_stdio_fix.h",
|
|
]
|
|
}
|
|
include_dirs = [ "." ]
|
|
deps = electron_app_link_deps + [ ":packed_resources" ]
|
|
|
|
data = []
|
|
data_deps = []
|
|
|
|
data += [ "$root_out_dir/resources.pak" ]
|
|
data += [ "$root_out_dir/chrome_100_percent.pak" ]
|
|
if (enable_hidpi) {
|
|
data += [ "$root_out_dir/chrome_200_percent.pak" ]
|
|
}
|
|
foreach(locale, platform_pak_locales) {
|
|
data += [ "$root_out_dir/locales/$locale.pak" ]
|
|
}
|
|
|
|
if (!is_mac) {
|
|
data += [ "$root_out_dir/resources/default_app.asar" ]
|
|
}
|
|
|
|
if (use_v8_context_snapshot) {
|
|
public_deps = [ "//tools/v8_context_snapshot" ]
|
|
}
|
|
|
|
if (is_linux) {
|
|
data_deps += [ "//components/crash/core/app:chrome_crashpad_handler" ]
|
|
}
|
|
|
|
if (is_win) {
|
|
sources += [
|
|
"$target_gen_dir/win-resources/electron.rc",
|
|
"shell/browser/resources/win/resource.h",
|
|
]
|
|
|
|
deps += [
|
|
"//chrome/app:exit_code_watcher",
|
|
"//components/crash/core/app:run_as_crashpad_handler",
|
|
]
|
|
|
|
# Ship the WER runtime exception helper next to the executable so that
|
|
# crashpad can register it; see :electron_wer.
|
|
data_deps += [ ":electron_wer" ]
|
|
|
|
ldflags = [ "/DELAYLOAD:ffmpeg.dll" ]
|
|
|
|
libs = [
|
|
"comctl32.lib",
|
|
"uiautomationcore.lib",
|
|
"wtsapi32.lib",
|
|
]
|
|
|
|
configs -= [ "//build/config/win:console" ]
|
|
configs += [
|
|
"//build/config/win:windowed",
|
|
"//build/config/win:delayloads",
|
|
]
|
|
|
|
if (current_cpu == "x86") {
|
|
# Set the initial stack size to 0.5MiB, instead of the 1.5MiB needed by
|
|
# Chrome's main thread. This saves significant memory on threads (like
|
|
# those in the Windows thread pool, and others) whose stack size we can
|
|
# only control through this setting. Because Chrome's main thread needs
|
|
# a minimum 1.5 MiB stack, the main thread (in 32-bit builds only) uses
|
|
# fibers to switch to a 1.5 MiB stack before running any other code.
|
|
ldflags += [ "/STACK:0x80000" ]
|
|
} else {
|
|
# Increase the initial stack size. The default is 1MB, this is 8MB.
|
|
ldflags += [ "/STACK:0x800000" ]
|
|
}
|
|
|
|
# This is to support renaming of electron.exe. node-gyp has hard-coded
|
|
# executable names which it will recognise as node. This module definition
|
|
# file claims that the electron executable is in fact named "node.exe",
|
|
# which is one of the executable names that node-gyp recognizes.
|
|
# See https://github.com/nodejs/node-gyp/commit/52ceec3a6d15de3a8f385f43dbe5ecf5456ad07a
|
|
ldflags += [ "/DEF:" + rebase_path("build/electron.def", root_build_dir) ]
|
|
inputs = [
|
|
"shell/browser/resources/win/electron.ico",
|
|
"build/electron.def",
|
|
]
|
|
}
|
|
if (is_linux) {
|
|
ldflags = [
|
|
"-pie",
|
|
|
|
# Required for exporting all symbols of libuv.
|
|
"-Wl,--whole-archive",
|
|
"obj/third_party/electron_node/deps/uv/libuv.a",
|
|
"-Wl,--no-whole-archive",
|
|
]
|
|
|
|
if (!is_component_build && is_component_ffmpeg) {
|
|
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
|
|
}
|
|
|
|
if (is_linux) {
|
|
deps += [ "//sandbox/linux:chrome_sandbox" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
if (is_win) {
|
|
# Windows Error Reporting runtime exception helper module. WerFault.exe
|
|
# loads this DLL out-of-process for crashes that bypass crashpad's
|
|
# in-process handler (e.g. __fastfail / STATUS_STACK_BUFFER_OVERRUN) and
|
|
# it asks the crashpad handler to dump the crashed process. It is
|
|
# registered by ElectronCrashReporterClient::GetWerRuntimeExceptionModule
|
|
# as <exe name>_wer.dll.
|
|
copy("electron_wer") {
|
|
sources = [ "$root_out_dir/crashpad_wer.dll" ]
|
|
outputs = [ "$root_out_dir/${electron_project_name}_wer.dll" ]
|
|
deps = [ "//third_party/crashpad/crashpad/handler/win/wer:crashpad_wer" ]
|
|
}
|
|
}
|
|
|
|
if (is_official_build) {
|
|
if (is_linux) {
|
|
_target_executable_suffix = ""
|
|
_target_shared_library_suffix = ".so"
|
|
} else if (is_win) {
|
|
_target_executable_suffix = ".exe"
|
|
_target_shared_library_suffix = ".dll"
|
|
}
|
|
|
|
extract_symbols("electron_app_symbols") {
|
|
binary = "$root_out_dir/$electron_project_name$_target_executable_suffix"
|
|
symbol_dir = "$root_out_dir/breakpad_symbols"
|
|
deps = [ ":electron_app" ]
|
|
}
|
|
|
|
group("electron_symbols") {
|
|
deps = [ ":electron_app_symbols" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
template("dist_zip") {
|
|
_runtime_deps_target = "${target_name}__deps"
|
|
_runtime_deps_file =
|
|
"$root_out_dir/gen.runtime/" + get_label_info(target_name, "dir") + "/" +
|
|
get_label_info(target_name, "name") + ".runtime_deps"
|
|
|
|
group(_runtime_deps_target) {
|
|
forward_variables_from(invoker,
|
|
[
|
|
"deps",
|
|
"data_deps",
|
|
"data",
|
|
"testonly",
|
|
])
|
|
write_runtime_deps = _runtime_deps_file
|
|
}
|
|
|
|
action(target_name) {
|
|
script = "//electron/build/zip.py"
|
|
deps = [ ":$_runtime_deps_target" ]
|
|
if (defined(invoker.build_deps)) {
|
|
# Ordered before the zip without contributing to its runtime deps.
|
|
deps += invoker.build_deps
|
|
}
|
|
forward_variables_from(invoker,
|
|
[
|
|
"outputs",
|
|
"testonly",
|
|
])
|
|
flatten = false
|
|
flatten_relative_to = false
|
|
if (defined(invoker.flatten)) {
|
|
flatten = invoker.flatten
|
|
if (defined(invoker.flatten_relative_to)) {
|
|
flatten_relative_to = invoker.flatten_relative_to
|
|
}
|
|
}
|
|
args = rebase_path(outputs + [ _runtime_deps_file ], root_build_dir) + [
|
|
target_cpu,
|
|
target_os,
|
|
"$flatten",
|
|
"$flatten_relative_to",
|
|
]
|
|
}
|
|
}
|
|
|
|
copy("electron_license") {
|
|
sources = [ "LICENSE" ]
|
|
outputs = [ "$root_build_dir/{{source_file_part}}" ]
|
|
}
|
|
|
|
copy("chromium_licenses") {
|
|
deps = [ "//components/resources:about_credits" ]
|
|
sources = [ "$root_gen_dir/components/resources/about_credits.html" ]
|
|
outputs = [ "$root_build_dir/LICENSES.chromium.html" ]
|
|
}
|
|
|
|
group("licenses") {
|
|
data_deps = [
|
|
":chromium_licenses",
|
|
":electron_license",
|
|
]
|
|
}
|
|
|
|
dist_zip("electron_dist_zip") {
|
|
data_deps = [
|
|
":electron_app",
|
|
":electron_version_file",
|
|
":licenses",
|
|
]
|
|
if (is_linux) {
|
|
if (is_official_build) {
|
|
data_deps += [
|
|
":strip_chrome_crashpad_handler",
|
|
":strip_chrome_sandbox",
|
|
":strip_electron_binary",
|
|
":strip_libffmpeg_shlib",
|
|
":strip_libvk_swiftshader_shlib",
|
|
]
|
|
}
|
|
|
|
data_deps += [ "//sandbox/linux:chrome_sandbox" ]
|
|
}
|
|
deps = data_deps
|
|
if (electron_use_resource_allowlist) {
|
|
build_deps = [ ":electron_resource_allowlist_check" ]
|
|
}
|
|
outputs = [ "$root_build_dir/dist.zip" ]
|
|
}
|
|
|
|
dist_zip("electron_ffmpeg_zip") {
|
|
data_deps = [ "//third_party/ffmpeg" ]
|
|
deps = data_deps
|
|
outputs = [ "$root_build_dir/ffmpeg.zip" ]
|
|
}
|
|
|
|
electron_chromedriver_deps = [
|
|
":licenses",
|
|
"//chrome/test/chromedriver:chromedriver_server",
|
|
"//electron/buildflags",
|
|
]
|
|
|
|
group("electron_chromedriver") {
|
|
testonly = true
|
|
public_deps = electron_chromedriver_deps
|
|
}
|
|
|
|
dist_zip("electron_chromedriver_zip") {
|
|
testonly = true
|
|
data_deps = electron_chromedriver_deps
|
|
deps = data_deps
|
|
outputs = [ "$root_build_dir/chromedriver.zip" ]
|
|
}
|
|
|
|
mksnapshot_deps = [
|
|
":licenses",
|
|
"//v8:mksnapshot($v8_snapshot_toolchain)",
|
|
]
|
|
|
|
if (use_v8_context_snapshot) {
|
|
mksnapshot_deps += [ "//tools/v8_context_snapshot:v8_context_snapshot_generator($v8_snapshot_toolchain)" ]
|
|
}
|
|
|
|
group("electron_mksnapshot") {
|
|
public_deps = mksnapshot_deps
|
|
}
|
|
|
|
dist_zip("electron_mksnapshot_zip") {
|
|
data_deps = mksnapshot_deps
|
|
|
|
# When the snapshot tools are built in a secondary toolchain (see
|
|
# //electron/build/toolchain/mac) their runtime deps live under
|
|
# $root_out_dir/<toolchain>/; flatten so mksnapshot.zip keeps the layout
|
|
# consumers (@electron/mksnapshot) expect on macOS: everything at the root.
|
|
if (is_mac && v8_snapshot_toolchain != default_toolchain) {
|
|
flatten = true
|
|
}
|
|
if (is_linux && is_official_build) {
|
|
data_deps += [
|
|
":strip_libffmpeg_shlib",
|
|
":strip_libvk_swiftshader_shlib",
|
|
":strip_mksnapshot_binary",
|
|
":strip_v8_context_snapshot_generator_binary",
|
|
]
|
|
}
|
|
deps = data_deps
|
|
outputs = [ "$root_build_dir/mksnapshot.zip" ]
|
|
}
|
|
|
|
copy("hunspell_dictionaries") {
|
|
sources = hunspell_dictionaries + hunspell_licenses
|
|
outputs = [ "$target_gen_dir/electron_hunspell/{{source_file_part}}" ]
|
|
}
|
|
|
|
dist_zip("hunspell_dictionaries_zip") {
|
|
data_deps = [ ":hunspell_dictionaries" ]
|
|
deps = data_deps
|
|
flatten = true
|
|
|
|
outputs = [ "$root_build_dir/hunspell_dictionaries.zip" ]
|
|
}
|
|
|
|
dist_zip("electron_xcache_zip") {
|
|
data_deps = [
|
|
":electron_xcache",
|
|
":licenses",
|
|
]
|
|
if (is_linux && is_official_build) {
|
|
data_deps += [ ":strip_electron_xcache_binary" ]
|
|
}
|
|
deps = data_deps
|
|
outputs = [ "$root_build_dir/xcache.zip" ]
|
|
}
|
|
|
|
copy("libcxx_headers") {
|
|
sources = libcxx_headers + libcxx_licenses + [
|
|
"//buildtools/third_party/libc++/__assertion_handler",
|
|
"//buildtools/third_party/libc++/__config_site",
|
|
]
|
|
outputs = [ "$target_gen_dir/electron_libcxx_include/{{source_root_relative_dir}}/{{source_file_part}}" ]
|
|
}
|
|
|
|
dist_zip("libcxx_headers_zip") {
|
|
data_deps = [ ":libcxx_headers" ]
|
|
deps = data_deps
|
|
flatten = true
|
|
flatten_relative_to =
|
|
rebase_path(
|
|
"$target_gen_dir/electron_libcxx_include/third_party/libc++/src",
|
|
"$root_out_dir")
|
|
|
|
outputs = [ "$root_build_dir/libcxx_headers.zip" ]
|
|
}
|
|
|
|
copy("libcxxabi_headers") {
|
|
sources = libcxxabi_headers + libcxxabi_licenses
|
|
outputs = [ "$target_gen_dir/electron_libcxxabi_include/{{source_root_relative_dir}}/{{source_file_part}}" ]
|
|
}
|
|
|
|
dist_zip("libcxxabi_headers_zip") {
|
|
data_deps = [ ":libcxxabi_headers" ]
|
|
deps = data_deps
|
|
flatten = true
|
|
flatten_relative_to = rebase_path(
|
|
"$target_gen_dir/electron_libcxxabi_include/third_party/libc++abi/src",
|
|
"$root_out_dir")
|
|
|
|
outputs = [ "$root_build_dir/libcxxabi_headers.zip" ]
|
|
}
|
|
|
|
action("libcxx_objects_zip") {
|
|
deps = [ "//buildtools/third_party/libc++" ]
|
|
script = "build/zip_libcxx.py"
|
|
outputs = [ "$root_build_dir/libcxx_objects.zip" ]
|
|
args = rebase_path(outputs)
|
|
}
|
|
|
|
if (is_debug || dcheck_always_on) {
|
|
# Test runners receive these assets rather than a full V8 checkout.
|
|
copy("v8_code_cache_spec_assets") {
|
|
sources = [
|
|
"//v8/LICENSE",
|
|
"//v8/test/mjsunit/wasm/wasm-module-builder.js",
|
|
]
|
|
outputs = [ "$root_gen_dir/electron/v8-code-cache/{{source_file_part}}" ]
|
|
}
|
|
}
|
|
|
|
group("electron") {
|
|
public_deps = [ ":electron_app" ]
|
|
if (is_debug || dcheck_always_on) {
|
|
data_deps = [ ":v8_code_cache_spec_assets" ]
|
|
}
|
|
}
|
|
|
|
##### node_headers
|
|
|
|
node_dir = "../third_party/electron_node"
|
|
node_headers_dir = "$root_gen_dir/node_headers"
|
|
|
|
copy("zlib_headers") {
|
|
sources = [
|
|
"$node_dir/deps/zlib/zconf.h",
|
|
"$node_dir/deps/zlib/zlib.h",
|
|
]
|
|
outputs = [ "$node_headers_dir/include/node/{{source_file_part}}" ]
|
|
}
|
|
|
|
copy("node_gypi_headers") {
|
|
deps = [ ":generate_config_gypi" ]
|
|
sources = [
|
|
"$node_dir/common.gypi",
|
|
"$root_gen_dir/config.gypi",
|
|
]
|
|
outputs = [ "$node_headers_dir/include/node/{{source_file_part}}" ]
|
|
}
|
|
|
|
action("node_version_header") {
|
|
inputs = [ "$node_dir/src/node_version.h" ]
|
|
outputs = [ "$node_headers_dir/include/node/node_version.h" ]
|
|
script = "script/node/generate_node_version_header.py"
|
|
args = rebase_path(inputs) + rebase_path(outputs)
|
|
if (node_module_version != "") {
|
|
args += [ "$node_module_version" ]
|
|
}
|
|
}
|
|
|
|
action("generate_node_headers") {
|
|
deps = [ ":generate_config_gypi" ]
|
|
script = "script/node/generate_node_headers.py"
|
|
inputs = auto_filenames.node_header_sources
|
|
outputs = [ "$root_gen_dir/node_headers.json" ]
|
|
args = [ rebase_path("$root_gen_dir") ]
|
|
}
|
|
|
|
action("tar_node_headers") {
|
|
deps = [ ":copy_node_headers" ]
|
|
outputs = [ "$root_gen_dir/node_headers.tar.gz" ]
|
|
script = "script/tar.py"
|
|
args = [
|
|
rebase_path("$root_gen_dir/node_headers"),
|
|
rebase_path(outputs[0]),
|
|
]
|
|
}
|
|
|
|
group("copy_node_headers") {
|
|
public_deps = [
|
|
":generate_node_headers",
|
|
":node_gypi_headers",
|
|
":node_version_header",
|
|
":zlib_headers",
|
|
]
|
|
}
|
|
|
|
group("node_headers") {
|
|
public_deps = [ ":tar_node_headers" ]
|
|
}
|
|
|
|
group("testing_build") {
|
|
public_deps = [
|
|
":electron_dist_zip",
|
|
":electron_mksnapshot_zip",
|
|
":node_headers",
|
|
]
|
|
if (is_debug || dcheck_always_on) {
|
|
data_deps = [ ":v8_code_cache_spec_assets" ]
|
|
}
|
|
if (!is_mas_build) {
|
|
public_deps += [ ":electron_xcache_zip" ]
|
|
}
|
|
}
|
|
|
|
group("release_build") {
|
|
public_deps = [ ":testing_build" ]
|
|
if (is_official_build) {
|
|
public_deps += [ ":electron_symbols" ]
|
|
}
|
|
if (is_linux) {
|
|
public_deps += [
|
|
":hunspell_dictionaries_zip",
|
|
":libcxx_headers_zip",
|
|
":libcxx_objects_zip",
|
|
":libcxxabi_headers_zip",
|
|
]
|
|
}
|
|
}
|
|
|
|
if (is_linux && is_official_build) {
|
|
strip_binary("strip_electron_binary") {
|
|
binary_input = "$root_out_dir/$electron_project_name"
|
|
symbol_output = "$root_out_dir/debug/$electron_project_name.debug"
|
|
compress_debug_sections = true
|
|
deps = [ ":electron_app" ]
|
|
}
|
|
|
|
strip_binary("strip_chrome_crashpad_handler") {
|
|
binary_input = "$root_out_dir/chrome_crashpad_handler"
|
|
symbol_output = "$root_out_dir/debug/chrome_crashpad_handler.debug"
|
|
compress_debug_sections = true
|
|
deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
|
|
}
|
|
|
|
strip_binary("strip_chrome_sandbox") {
|
|
binary_input = "$root_out_dir/chrome_sandbox"
|
|
symbol_output = "$root_out_dir/debug/chrome-sandbox.debug"
|
|
compress_debug_sections = true
|
|
deps = [ "//sandbox/linux:chrome_sandbox" ]
|
|
}
|
|
|
|
strip_binary("strip_electron_xcache_binary") {
|
|
binary_input = "$root_out_dir/electron_xcache"
|
|
symbol_output = "$root_out_dir/debug/electron_xcache.debug"
|
|
compress_debug_sections = true
|
|
deps = [ ":electron_xcache" ]
|
|
}
|
|
|
|
strip_binary("strip_libffmpeg_shlib") {
|
|
binary_input = "$root_out_dir/libffmpeg.so"
|
|
symbol_output = "$root_out_dir/debug/libffmpeg.so.debug"
|
|
compress_debug_sections = true
|
|
deps = [ "//third_party/ffmpeg" ]
|
|
}
|
|
|
|
strip_binary("strip_libvk_swiftshader_shlib") {
|
|
binary_input = "$root_out_dir/libvk_swiftshader.so"
|
|
symbol_output = "$root_out_dir/debug/libvk_swiftshader.so.debug"
|
|
compress_debug_sections = true
|
|
deps = [ "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan" ]
|
|
}
|
|
|
|
strip_binary("strip_mksnapshot_binary") {
|
|
_binary_path = rebase_path(
|
|
get_label_info(
|
|
":v8_context_snapshot_generator($v8_snapshot_toolchain)",
|
|
"root_out_dir") + "/mksnapshot",
|
|
root_build_dir)
|
|
binary_input = "$root_out_dir/$_binary_path"
|
|
symbol_output = "$root_out_dir/debug/${_binary_path}.debug"
|
|
compress_debug_sections = true
|
|
deps = mksnapshot_deps
|
|
}
|
|
|
|
strip_binary("strip_v8_context_snapshot_generator_binary") {
|
|
_binary_path = rebase_path(
|
|
get_label_info(
|
|
":v8_context_snapshot_generator($v8_snapshot_toolchain)",
|
|
"root_out_dir") + "/v8_context_snapshot_generator",
|
|
root_build_dir)
|
|
binary_input = "$root_out_dir/$_binary_path"
|
|
symbol_output = "$root_out_dir/debug/${_binary_path}.debug"
|
|
compress_debug_sections = true
|
|
deps = mksnapshot_deps
|
|
}
|
|
}
|