2018-09-06 00:00:37 +03:00
|
|
|
import("//build/config/locales.gni")
|
2018-10-24 13:49:10 +03:00
|
|
|
import("//build/config/ui.gni")
|
2018-09-06 00:00:37 +03:00
|
|
|
import("//build/config/win/manifest.gni")
|
|
|
|
import("//pdf/features.gni")
|
2019-04-02 04:25:19 +03:00
|
|
|
import("//printing/buildflags/buildflags.gni")
|
2018-07-31 01:46:04 +03:00
|
|
|
import("//third_party/ffmpeg/ffmpeg_options.gni")
|
2018-11-10 22:21:40 +03:00
|
|
|
import("//tools/generate_library_loader/generate_library_loader.gni")
|
2018-10-04 21:08:56 +03:00
|
|
|
import("//tools/grit/grit_rule.gni")
|
2018-09-06 00:00:37 +03:00
|
|
|
import("//tools/grit/repack.gni")
|
|
|
|
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
|
2019-05-22 21:45:48 +03:00
|
|
|
import("//v8/gni/snapshot_toolchain.gni")
|
2019-01-10 13:40:27 +03:00
|
|
|
import("build/asar.gni")
|
|
|
|
import("build/npm.gni")
|
2019-06-20 00:31:55 +03:00
|
|
|
import("build/templated_file.gni")
|
2019-02-06 21:27:20 +03:00
|
|
|
import("build/tsc.gni")
|
2019-06-02 23:03:03 +03:00
|
|
|
import("build/webpack/webpack.gni")
|
2019-01-10 13:40:27 +03:00
|
|
|
import("buildflags/buildflags.gni")
|
|
|
|
import("electron_paks.gni")
|
2019-02-06 21:27:20 +03:00
|
|
|
import("filenames.auto.gni")
|
2019-01-10 13:40:27 +03:00
|
|
|
import("filenames.gni")
|
2018-05-04 01:44:29 +03:00
|
|
|
|
|
|
|
if (is_mac) {
|
|
|
|
import("//build/config/mac/rules.gni")
|
|
|
|
import("//third_party/icu/config.gni")
|
|
|
|
import("//v8/gni/v8.gni")
|
|
|
|
}
|
|
|
|
|
2018-05-16 22:51:11 +03:00
|
|
|
if (is_linux) {
|
|
|
|
import("//build/config/linux/pkg_config.gni")
|
|
|
|
|
|
|
|
pkg_config("gio_unix") {
|
|
|
|
packages = [ "gio-unix-2.0" ]
|
|
|
|
}
|
2018-11-10 22:21:40 +03:00
|
|
|
|
|
|
|
pkg_config("libnotify_config") {
|
|
|
|
packages = [
|
|
|
|
"glib-2.0",
|
|
|
|
"gdk-pixbuf-2.0",
|
|
|
|
]
|
|
|
|
}
|
2018-05-16 22:51:11 +03:00
|
|
|
}
|
|
|
|
|
2019-06-19 23:46:59 +03:00
|
|
|
branding = read_file("shell/app/BRANDING.json", "json")
|
2018-09-27 21:53:08 +03:00
|
|
|
electron_project_name = branding.project_name
|
|
|
|
electron_product_name = branding.product_name
|
|
|
|
electron_mac_bundle_id = branding.mac_bundle_id
|
2018-05-04 01:44:29 +03:00
|
|
|
|
2018-06-29 01:43:21 +03:00
|
|
|
if (is_mas_build) {
|
2018-07-31 01:55:41 +03:00
|
|
|
assert(is_mac,
|
|
|
|
"It doesn't make sense to build a MAS build on a non-mac platform")
|
2018-05-04 01:44:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
config("branding") {
|
|
|
|
defines = [
|
2019-06-17 23:37:55 +03:00
|
|
|
"ELECTRON_PRODUCT_NAME=\"$electron_product_name\"",
|
|
|
|
"ELECTRON_PROJECT_NAME=\"$electron_project_name\"",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-02-06 21:27:20 +03:00
|
|
|
# We geneate the definitions twice here, once in //electron/electron.d.ts
|
|
|
|
# and once in $target_gen_dir
|
|
|
|
# The one in $target_gen_dir is used for the actual TSC build later one
|
|
|
|
# and the one in //electron/electron.d.ts is used by your IDE (vscode)
|
|
|
|
# for typescript prompting
|
|
|
|
npm_action("build_electron_definitions") {
|
|
|
|
script = "gn-typescript-definitions"
|
|
|
|
args = [ rebase_path("$target_gen_dir/tsc/typings/electron.d.ts") ]
|
2019-04-30 23:59:47 +03:00
|
|
|
inputs = auto_filenames.api_docs + [ "yarn.lock" ]
|
2019-02-06 21:27:20 +03:00
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"$target_gen_dir/tsc/typings/electron.d.ts",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
webpack_build("electron_browser_bundle") {
|
2019-02-12 17:22:33 +03:00
|
|
|
deps = [
|
|
|
|
":build_electron_definitions",
|
|
|
|
]
|
2018-05-04 01:44:29 +03:00
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
inputs = auto_filenames.browser_bundle_deps
|
2019-01-12 04:00:43 +03:00
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
config_file = "//electron/build/webpack/webpack.config.browser.js"
|
2019-06-04 03:03:59 +03:00
|
|
|
out_file = "$target_gen_dir/js2c/browser_init.js"
|
2018-05-04 01:44:29 +03:00
|
|
|
}
|
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
webpack_build("electron_renderer_bundle") {
|
2019-02-12 17:22:33 +03:00
|
|
|
deps = [
|
|
|
|
":build_electron_definitions",
|
|
|
|
]
|
2018-05-04 01:44:29 +03:00
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
inputs = auto_filenames.renderer_bundle_deps
|
2018-05-04 01:44:29 +03:00
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
config_file = "//electron/build/webpack/webpack.config.renderer.js"
|
2019-06-04 03:03:59 +03:00
|
|
|
out_file = "$target_gen_dir/js2c/renderer_init.js"
|
2018-05-04 01:44:29 +03:00
|
|
|
}
|
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
webpack_build("electron_worker_bundle") {
|
2019-03-12 02:27:57 +03:00
|
|
|
deps = [
|
|
|
|
":build_electron_definitions",
|
|
|
|
]
|
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
inputs = auto_filenames.worker_bundle_deps
|
2019-03-12 02:27:57 +03:00
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
config_file = "//electron/build/webpack/webpack.config.worker.js"
|
2019-06-04 03:03:59 +03:00
|
|
|
out_file = "$target_gen_dir/js2c/worker_init.js"
|
2019-03-12 02:27:57 +03:00
|
|
|
}
|
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
webpack_build("electron_sandboxed_renderer_bundle") {
|
2019-04-16 20:57:02 +03:00
|
|
|
deps = [
|
2019-06-02 23:03:03 +03:00
|
|
|
":build_electron_definitions",
|
2019-04-16 20:57:02 +03:00
|
|
|
]
|
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
inputs = auto_filenames.sandbox_bundle_deps
|
2019-04-16 20:57:02 +03:00
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
config_file = "//electron/build/webpack/webpack.config.sandboxed_renderer.js"
|
|
|
|
out_file = "$target_gen_dir/js2c/sandbox_bundle.js"
|
2019-04-16 20:57:02 +03:00
|
|
|
}
|
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
webpack_build("electron_isolated_renderer_bundle") {
|
2019-04-16 20:57:02 +03:00
|
|
|
deps = [
|
2019-06-02 23:03:03 +03:00
|
|
|
":build_electron_definitions",
|
2019-04-16 20:57:02 +03:00
|
|
|
]
|
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
inputs = auto_filenames.isolated_bundle_deps
|
2019-04-16 20:57:02 +03:00
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
config_file = "//electron/build/webpack/webpack.config.isolated_renderer.js"
|
|
|
|
out_file = "$target_gen_dir/js2c/isolated_bundle.js"
|
2019-04-16 20:57:02 +03:00
|
|
|
}
|
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
webpack_build("electron_content_script_bundle") {
|
2019-04-16 20:57:02 +03:00
|
|
|
deps = [
|
2019-06-02 23:03:03 +03:00
|
|
|
":build_electron_definitions",
|
2019-04-16 20:57:02 +03:00
|
|
|
]
|
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
inputs = auto_filenames.content_script_bundle_deps
|
2019-04-16 20:57:02 +03:00
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
config_file = "//electron/build/webpack/webpack.config.content_script.js"
|
|
|
|
out_file = "$target_gen_dir/js2c/content_script_bundle.js"
|
2019-04-16 20:57:02 +03:00
|
|
|
}
|
|
|
|
|
2018-05-04 01:44:29 +03:00
|
|
|
copy("atom_js2c_copy") {
|
|
|
|
sources = [
|
|
|
|
"lib/common/asar.js",
|
|
|
|
"lib/common/asar_init.js",
|
|
|
|
]
|
2018-07-31 01:55:41 +03:00
|
|
|
outputs = [
|
|
|
|
"$target_gen_dir/js2c/{{source_file_part}}",
|
|
|
|
]
|
2018-05-04 01:44:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
action("atom_js2c") {
|
|
|
|
deps = [
|
2018-07-31 01:55:41 +03:00
|
|
|
":atom_js2c_copy",
|
2019-06-04 03:03:59 +03:00
|
|
|
":electron_browser_bundle",
|
2019-06-02 23:03:03 +03:00
|
|
|
":electron_content_script_bundle",
|
|
|
|
":electron_isolated_renderer_bundle",
|
2019-06-04 03:03:59 +03:00
|
|
|
":electron_renderer_bundle",
|
2019-06-02 23:03:03 +03:00
|
|
|
":electron_sandboxed_renderer_bundle",
|
2019-06-04 03:03:59 +03:00
|
|
|
":electron_worker_bundle",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
webpack_sources = [
|
2019-06-04 03:03:59 +03:00
|
|
|
"$target_gen_dir/js2c/browser_init.js",
|
|
|
|
"$target_gen_dir/js2c/renderer_init.js",
|
|
|
|
"$target_gen_dir/js2c/worker_init.js",
|
2019-03-12 02:27:57 +03:00
|
|
|
"$target_gen_dir/js2c/content_script_bundle.js",
|
2018-05-04 01:44:29 +03:00
|
|
|
"$target_gen_dir/js2c/isolated_bundle.js",
|
2019-04-18 00:18:03 +03:00
|
|
|
"$target_gen_dir/js2c/sandbox_bundle.js",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
|
|
|
|
2019-06-02 23:03:03 +03:00
|
|
|
sources = webpack_sources + [
|
2019-01-12 04:00:43 +03:00
|
|
|
"$target_gen_dir/js2c/asar.js",
|
|
|
|
"$target_gen_dir/js2c/asar_init.js",
|
|
|
|
]
|
2018-05-04 01:44:29 +03:00
|
|
|
|
2019-01-12 04:00:43 +03:00
|
|
|
inputs = sources
|
2018-07-31 01:55:41 +03:00
|
|
|
outputs = [
|
2019-01-12 04:00:43 +03:00
|
|
|
"$root_gen_dir/atom_natives.cc",
|
2018-07-31 01:55:41 +03:00
|
|
|
]
|
2018-05-04 01:44:29 +03:00
|
|
|
|
|
|
|
script = "tools/js2c.py"
|
2018-07-31 01:55:41 +03:00
|
|
|
args = [ rebase_path("//third_party/electron_node") ] +
|
|
|
|
rebase_path(outputs, root_build_dir) +
|
2019-01-12 04:00:43 +03:00
|
|
|
rebase_path(sources, root_build_dir)
|
2018-05-04 01:44:29 +03:00
|
|
|
}
|
|
|
|
|
2019-02-05 23:10:15 +03:00
|
|
|
target_gen_default_app_js = "$target_gen_dir/js/default_app"
|
|
|
|
|
2019-02-06 21:27:20 +03:00
|
|
|
typescript_build("default_app_js") {
|
|
|
|
deps = [
|
|
|
|
":build_electron_definitions",
|
|
|
|
]
|
|
|
|
type_root = rebase_path("$target_gen_dir/tsc/electron/typings")
|
|
|
|
|
|
|
|
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
|
2019-02-05 23:10:15 +03:00
|
|
|
outputs = [
|
|
|
|
"$target_gen_default_app_js/{{source}}",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
copy("default_app_octicon_deps") {
|
|
|
|
sources = filenames.default_app_octicon_sources
|
|
|
|
outputs = [
|
|
|
|
"$target_gen_default_app_js/electron/default_app/octicon/{{source_file_part}}",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
asar("default_app_asar") {
|
|
|
|
deps = [
|
|
|
|
":default_app_js",
|
|
|
|
":default_app_octicon_deps",
|
2019-02-06 21:27:20 +03:00
|
|
|
":default_app_static",
|
2019-02-05 23:10:15 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
root = "$target_gen_default_app_js/electron/default_app"
|
|
|
|
sources = get_target_outputs(":default_app_js") +
|
2019-02-06 21:27:20 +03:00
|
|
|
get_target_outputs(":default_app_static") +
|
2019-02-05 23:10:15 +03:00
|
|
|
get_target_outputs(":default_app_octicon_deps")
|
2018-07-31 01:55:41 +03:00
|
|
|
outputs = [
|
|
|
|
"$root_out_dir/resources/default_app.asar",
|
|
|
|
]
|
2018-05-04 01:44:29 +03:00
|
|
|
}
|
|
|
|
|
2018-10-04 21:08:56 +03:00
|
|
|
grit("resources") {
|
|
|
|
source = "electron_resources.grd"
|
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"grit/electron_resources.h",
|
|
|
|
"electron_resources.pak",
|
|
|
|
]
|
|
|
|
|
2019-01-12 04:00:43 +03:00
|
|
|
# Mojo manifest overlays are generated.
|
|
|
|
source_is_generated = true
|
2018-10-04 21:08:56 +03:00
|
|
|
grit_flags = [
|
|
|
|
"-E",
|
|
|
|
"target_gen_dir=" + rebase_path(target_gen_dir, root_build_dir),
|
|
|
|
]
|
|
|
|
|
|
|
|
deps = [
|
2019-01-12 04:00:43 +03:00
|
|
|
":copy_shell_devtools_discovery_page",
|
2018-10-04 21:08:56 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
output_dir = "$target_gen_dir"
|
|
|
|
}
|
|
|
|
|
2019-01-12 04:00:43 +03:00
|
|
|
copy("copy_shell_devtools_discovery_page") {
|
|
|
|
sources = [
|
|
|
|
"//content/shell/resources/shell_devtools_discovery_page.html",
|
|
|
|
]
|
|
|
|
outputs = [
|
|
|
|
"$target_gen_dir/shell_devtools_discovery_page.html",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-11-10 22:21:40 +03:00
|
|
|
if (is_linux) {
|
|
|
|
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_hint_string",
|
|
|
|
"notify_notification_show",
|
|
|
|
"notify_notification_close",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-02 04:25:19 +03:00
|
|
|
source_set("manifests") {
|
|
|
|
sources = [
|
2019-06-19 23:46:59 +03:00
|
|
|
"//electron/shell/app/manifests.cc",
|
|
|
|
"//electron/shell/app/manifests.h",
|
2019-04-02 04:25:19 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
include_dirs = [ "//electron" ]
|
|
|
|
|
|
|
|
deps = [
|
2019-06-19 23:46:59 +03:00
|
|
|
"//electron/shell/common/api:mojo",
|
2019-04-02 04:25:19 +03:00
|
|
|
"//printing/buildflags",
|
|
|
|
"//services/proxy_resolver/public/cpp:manifest",
|
2019-04-03 01:38:16 +03:00
|
|
|
"//services/service_manager/public/cpp",
|
2019-04-02 04:25:19 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
if (enable_basic_printing) {
|
|
|
|
deps += [ "//components/services/pdf_compositor/public/cpp:manifest" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enable_print_preview) {
|
|
|
|
deps += [ "//chrome/services/printing/public/cpp:manifest" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-20 00:31:55 +03:00
|
|
|
npm_action("electron_version_args") {
|
|
|
|
script = "generate-version-json"
|
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"$target_gen_dir/electron_version.args",
|
|
|
|
]
|
|
|
|
|
|
|
|
args = rebase_path(outputs)
|
|
|
|
|
|
|
|
inputs = [
|
|
|
|
"ELECTRON_VERSION",
|
|
|
|
"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")
|
|
|
|
}
|
|
|
|
|
2018-05-04 01:44:29 +03:00
|
|
|
static_library("electron_lib") {
|
2018-07-31 01:55:41 +03:00
|
|
|
configs += [ "//v8:external_startup_data" ]
|
2018-08-08 20:43:52 +03:00
|
|
|
configs += [ "//third_party/electron_node:node_internals" ]
|
2018-07-20 02:30:23 +03:00
|
|
|
|
2018-10-01 23:00:53 +03:00
|
|
|
public_configs = [ ":branding" ]
|
2018-07-20 02:30:23 +03:00
|
|
|
|
2018-05-04 01:44:29 +03:00
|
|
|
deps = [
|
2018-07-20 02:30:23 +03:00
|
|
|
":atom_js2c",
|
2019-06-20 00:31:55 +03:00
|
|
|
":electron_version_header",
|
2019-04-02 04:25:19 +03:00
|
|
|
":manifests",
|
2019-03-05 08:08:55 +03:00
|
|
|
":resources",
|
2018-10-01 23:00:53 +03:00
|
|
|
"buildflags",
|
2018-09-12 16:45:08 +03:00
|
|
|
"chromium_src:chrome",
|
2018-07-20 02:30:23 +03:00
|
|
|
"native_mate",
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/common/api:mojo",
|
2018-10-24 13:49:10 +03:00
|
|
|
"//base:base_static",
|
2019-03-05 08:08:55 +03:00
|
|
|
"//base/allocator:buildflags",
|
2018-11-08 17:51:51 +03:00
|
|
|
"//chrome/app/resources:platform_locale_settings",
|
2018-10-04 21:08:56 +03:00
|
|
|
"//components/certificate_transparency",
|
|
|
|
"//components/net_log",
|
2018-05-04 01:44:29 +03:00
|
|
|
"//components/network_session_configurator/common",
|
|
|
|
"//components/prefs",
|
2018-10-26 20:34:57 +03:00
|
|
|
"//components/spellcheck/renderer",
|
2018-11-08 19:58:54 +03:00
|
|
|
"//components/viz/host",
|
2018-06-20 22:50:43 +03:00
|
|
|
"//components/viz/service",
|
2018-10-24 13:49:10 +03:00
|
|
|
"//content/public/browser",
|
2018-07-11 21:32:17 +03:00
|
|
|
"//content/public/child",
|
2018-10-04 21:08:56 +03:00
|
|
|
"//content/public/common:service_names",
|
2019-04-30 19:45:48 +03:00
|
|
|
"//content/public/gpu",
|
2019-03-05 08:08:55 +03:00
|
|
|
"//content/public/renderer",
|
|
|
|
"//content/public/utility",
|
|
|
|
"//device/bluetooth",
|
2018-05-04 01:44:29 +03:00
|
|
|
"//gin",
|
2018-11-08 19:58:54 +03:00
|
|
|
"//media/capture/mojom:video_capture",
|
2018-10-05 22:00:07 +03:00
|
|
|
"//media/mojo/interfaces",
|
2018-10-24 13:49:10 +03:00
|
|
|
"//net:extras",
|
2018-05-04 01:44:29 +03:00
|
|
|
"//net:net_resources",
|
2018-10-24 13:49:10 +03:00
|
|
|
"//net:net_with_v8",
|
2018-05-04 01:44:29 +03:00
|
|
|
"//ppapi/host",
|
|
|
|
"//ppapi/proxy",
|
|
|
|
"//ppapi/shared_impl",
|
2019-03-05 08:08:55 +03:00
|
|
|
"//printing/buildflags",
|
2019-02-06 22:03:39 +03:00
|
|
|
"//services/audio/public/mojom:constants",
|
2019-03-08 01:48:22 +03:00
|
|
|
"//services/device/public/cpp/geolocation",
|
2018-10-24 08:12:58 +03:00
|
|
|
"//services/device/public/mojom",
|
2018-10-04 21:08:56 +03:00
|
|
|
"//services/proxy_resolver:lib",
|
2019-02-06 22:03:39 +03:00
|
|
|
"//services/video_capture/public/mojom:constants",
|
2018-11-08 19:58:54 +03:00
|
|
|
"//services/viz/privileged/interfaces/compositing",
|
2018-05-04 01:44:29 +03:00
|
|
|
"//skia",
|
2018-07-20 19:08:18 +03:00
|
|
|
"//third_party/blink/public:blink",
|
2018-05-04 01:44:29 +03:00
|
|
|
"//third_party/boringssl",
|
2018-08-18 01:28:00 +03:00
|
|
|
"//third_party/electron_node:node_lib",
|
2018-05-04 01:44:29 +03:00
|
|
|
"//third_party/leveldatabase",
|
|
|
|
"//third_party/libyuv",
|
2018-07-25 01:43:42 +03:00
|
|
|
"//third_party/webrtc_overrides:init_webrtc",
|
2018-09-06 00:00:37 +03:00
|
|
|
"//third_party/widevine/cdm:headers",
|
2019-03-22 04:07:21 +03:00
|
|
|
"//ui/base/idle",
|
2018-05-04 01:44:29 +03:00
|
|
|
"//ui/events:dom_keycode_converter",
|
2018-06-20 22:50:43 +03:00
|
|
|
"//ui/gl",
|
2019-03-05 08:08:55 +03:00
|
|
|
"//ui/native_theme",
|
|
|
|
"//ui/shell_dialogs",
|
2018-05-04 01:44:29 +03:00
|
|
|
"//ui/views",
|
|
|
|
"//v8",
|
2019-03-05 08:08:55 +03:00
|
|
|
"//v8:v8_libplatform",
|
|
|
|
]
|
|
|
|
|
|
|
|
public_deps = [
|
|
|
|
"//base",
|
|
|
|
"//base:i18n",
|
|
|
|
"//content/public/app:both",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
2018-07-20 02:30:23 +03:00
|
|
|
|
2018-07-11 20:49:17 +03:00
|
|
|
include_dirs = [
|
|
|
|
"chromium_src",
|
|
|
|
".",
|
|
|
|
"$target_gen_dir",
|
2018-07-20 02:30:23 +03:00
|
|
|
|
2018-07-11 20:49:17 +03:00
|
|
|
# TODO(nornagon): replace usage of SchemeRegistry by an actually exported
|
2018-08-15 00:49:35 +03:00
|
|
|
# API of blink, then remove this from the include_dirs.
|
2018-07-20 19:08:18 +03:00
|
|
|
"//third_party/blink/renderer",
|
2018-07-11 20:49:17 +03:00
|
|
|
]
|
2018-07-20 02:30:23 +03:00
|
|
|
|
2018-11-28 00:42:02 +03:00
|
|
|
defines = [ "V8_DEPRECATION_WARNINGS" ]
|
2018-07-25 04:21:36 +03:00
|
|
|
libs = []
|
2018-07-20 02:30:23 +03:00
|
|
|
|
2018-11-28 00:42:02 +03:00
|
|
|
if (is_linux) {
|
|
|
|
defines += [ "GDK_DISABLE_DEPRECATION_WARNINGS" ]
|
|
|
|
}
|
|
|
|
|
2018-07-20 02:30:23 +03:00
|
|
|
extra_source_filters = []
|
|
|
|
if (!is_linux) {
|
|
|
|
extra_source_filters += [
|
|
|
|
"*\bx/*",
|
|
|
|
"*_x11.h",
|
|
|
|
"*_x11.cc",
|
|
|
|
"*_gtk.h",
|
|
|
|
"*_gtk.cc",
|
|
|
|
"*\blibrary_loaders/*",
|
|
|
|
]
|
2018-06-29 00:58:43 +03:00
|
|
|
}
|
2018-07-20 02:30:23 +03:00
|
|
|
if (!is_win) {
|
|
|
|
extra_source_filters += [
|
|
|
|
"*\bwin_*.h",
|
|
|
|
"*\bwin_*.cc",
|
|
|
|
]
|
|
|
|
}
|
2018-09-20 00:54:43 +03:00
|
|
|
if (!is_posix) {
|
|
|
|
extra_source_filters += [
|
|
|
|
"*_posix.cc",
|
|
|
|
"*_posix.h",
|
|
|
|
]
|
|
|
|
}
|
2018-07-20 02:30:23 +03:00
|
|
|
if (is_mac) {
|
|
|
|
extra_source_filters += [
|
|
|
|
"*_views.cc",
|
|
|
|
"*_views.h",
|
|
|
|
"*\bviews/*",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
set_sources_assignment_filter(
|
|
|
|
sources_assignment_filter + extra_source_filters)
|
2018-09-09 04:15:32 +03:00
|
|
|
sources = filenames.lib_sources
|
2018-07-20 02:30:23 +03:00
|
|
|
set_sources_assignment_filter(sources_assignment_filter)
|
|
|
|
|
|
|
|
if (is_component_build) {
|
2018-08-29 11:39:47 +03:00
|
|
|
defines += [ "NODE_SHARED_MODE" ]
|
2018-06-29 00:58:43 +03:00
|
|
|
}
|
2018-07-20 02:30:23 +03:00
|
|
|
|
2018-08-23 18:51:46 +03:00
|
|
|
if (enable_fake_location_provider) {
|
2018-09-09 04:15:32 +03:00
|
|
|
sources += [
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/browser/fake_location_provider.cc",
|
|
|
|
"shell/browser/fake_location_provider.h",
|
2018-09-09 04:15:32 +03:00
|
|
|
]
|
2018-08-23 18:51:46 +03:00
|
|
|
}
|
|
|
|
|
2018-05-04 01:44:29 +03:00
|
|
|
if (is_mac) {
|
|
|
|
deps += [
|
2019-05-03 21:30:03 +03:00
|
|
|
"//components/remote_cocoa/app_shim",
|
2018-07-20 02:30:23 +03:00
|
|
|
"//ui/accelerated_widget_mac",
|
2018-06-29 23:39:22 +03:00
|
|
|
]
|
2019-02-11 22:38:58 +03:00
|
|
|
sources += [
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/browser/ui/views/autofill_popup_view.cc",
|
|
|
|
"shell/browser/ui/views/autofill_popup_view.h",
|
2019-02-11 22:38:58 +03:00
|
|
|
]
|
2018-07-20 02:30:23 +03:00
|
|
|
if (is_mas_build) {
|
2019-06-19 23:46:59 +03:00
|
|
|
sources += [ "shell/browser/api/atom_api_app_mas.mm" ]
|
2018-07-20 02:30:23 +03:00
|
|
|
sources -= [
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/browser/auto_updater_mac.mm",
|
|
|
|
"shell/common/crash_reporter/crash_reporter_mac.h",
|
|
|
|
"shell/common/crash_reporter/crash_reporter_mac.mm",
|
2018-07-20 02:30:23 +03:00
|
|
|
]
|
|
|
|
defines += [ "MAS_BUILD" ]
|
|
|
|
} else {
|
2018-07-25 04:21:36 +03:00
|
|
|
libs += [
|
2018-07-20 02:30:23 +03:00
|
|
|
"Squirrel.framework",
|
|
|
|
"ReactiveCocoa.framework",
|
|
|
|
"Mantle.framework",
|
|
|
|
]
|
|
|
|
cflags_objcc = [
|
|
|
|
"-F",
|
|
|
|
rebase_path("external_binaries", root_build_dir),
|
|
|
|
]
|
|
|
|
|
|
|
|
# ReactiveCocoa which is used by Squirrel requires using __weak.
|
|
|
|
cflags_objcc += [ "-fobjc-weak" ]
|
|
|
|
}
|
2018-05-04 01:44:29 +03:00
|
|
|
}
|
2018-05-16 22:51:11 +03:00
|
|
|
if (is_linux) {
|
|
|
|
deps += [
|
2018-11-10 22:21:40 +03:00
|
|
|
":libnotify_loader",
|
2018-06-29 23:43:13 +03:00
|
|
|
"//build/config/linux/gtk",
|
2018-05-16 22:51:11 +03:00
|
|
|
"//chrome/browser/ui/libgtkui",
|
2018-10-27 06:57:41 +03:00
|
|
|
"//dbus",
|
2018-05-16 22:51:11 +03:00
|
|
|
"//device/bluetooth",
|
2019-06-13 09:42:21 +03:00
|
|
|
"//third_party/breakpad:client",
|
2018-05-16 22:51:11 +03:00
|
|
|
"//ui/events/devices/x11",
|
|
|
|
"//ui/events/platform/x11",
|
2019-06-13 09:42:21 +03:00
|
|
|
"//ui/views/controls/webview",
|
|
|
|
"//ui/wm",
|
2018-05-16 22:51:11 +03:00
|
|
|
]
|
|
|
|
configs += [ ":gio_unix" ]
|
2019-06-13 09:42:21 +03:00
|
|
|
include_dirs += [ "//third_party/breakpad" ]
|
2018-07-11 20:45:21 +03:00
|
|
|
defines += [
|
2018-07-20 02:30:23 +03:00
|
|
|
# Disable warnings for g_settings_list_schemas.
|
|
|
|
"GLIB_DISABLE_DEPRECATION_WARNINGS",
|
2018-07-11 20:45:21 +03:00
|
|
|
]
|
2018-10-13 04:57:04 +03:00
|
|
|
|
2018-09-09 04:15:32 +03:00
|
|
|
sources += filenames.lib_sources_nss
|
2018-07-20 02:30:23 +03:00
|
|
|
}
|
|
|
|
if (is_win) {
|
2018-07-25 04:21:36 +03:00
|
|
|
libs += [ "dwmapi.lib" ]
|
2019-03-05 08:08:55 +03:00
|
|
|
deps += [
|
|
|
|
"//ui/native_theme:native_theme_browser",
|
2019-06-13 09:42:21 +03:00
|
|
|
"//ui/views/controls/webview",
|
|
|
|
"//ui/wm",
|
2019-03-05 08:08:55 +03:00
|
|
|
"//ui/wm/public",
|
|
|
|
]
|
2019-06-13 09:42:21 +03:00
|
|
|
public_deps += [
|
|
|
|
"//sandbox/win:sandbox",
|
|
|
|
"//third_party/crashpad/crashpad/handler",
|
|
|
|
]
|
2018-07-11 20:45:21 +03:00
|
|
|
}
|
2019-06-13 09:42:21 +03:00
|
|
|
|
|
|
|
if ((is_mac && !is_mas_build) || is_win) {
|
|
|
|
sources += [
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/common/crash_reporter/crash_reporter_crashpad.cc",
|
|
|
|
"shell/common/crash_reporter/crash_reporter_crashpad.h",
|
2019-03-05 08:08:55 +03:00
|
|
|
]
|
2019-06-13 09:42:21 +03:00
|
|
|
deps += [ "//third_party/crashpad/crashpad/client" ]
|
2018-05-16 22:51:11 +03:00
|
|
|
}
|
2018-05-04 01:44:29 +03:00
|
|
|
|
2018-07-20 02:30:23 +03:00
|
|
|
if (enable_pdf) {
|
|
|
|
deps += [ "//pdf" ]
|
2018-05-04 01:44:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (enable_run_as_node) {
|
|
|
|
sources += [
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/app/node_main.cc",
|
|
|
|
"shell/app/node_main.h",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enable_osr) {
|
|
|
|
sources += [
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/browser/osr/osr_host_display_client.cc",
|
|
|
|
"shell/browser/osr/osr_host_display_client.h",
|
|
|
|
"shell/browser/osr/osr_host_display_client_mac.mm",
|
|
|
|
"shell/browser/osr/osr_render_widget_host_view.cc",
|
|
|
|
"shell/browser/osr/osr_render_widget_host_view.h",
|
|
|
|
"shell/browser/osr/osr_video_consumer.cc",
|
|
|
|
"shell/browser/osr/osr_video_consumer.h",
|
|
|
|
"shell/browser/osr/osr_view_proxy.cc",
|
|
|
|
"shell/browser/osr/osr_view_proxy.h",
|
|
|
|
"shell/browser/osr/osr_web_contents_view.cc",
|
|
|
|
"shell/browser/osr/osr_web_contents_view.h",
|
|
|
|
"shell/browser/osr/osr_web_contents_view_mac.mm",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
|
|
|
deps += [
|
|
|
|
"//components/viz/service",
|
2018-08-29 01:54:45 +03:00
|
|
|
"//services/viz/public/interfaces",
|
2018-07-20 02:30:23 +03:00
|
|
|
"//ui/compositor",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-06-19 18:29:36 +03:00
|
|
|
if (enable_desktop_capturer) {
|
2018-08-27 18:17:23 +03:00
|
|
|
if (is_component_build && is_win) {
|
|
|
|
# On windows the implementation relies on unexported
|
|
|
|
# DxgiDuplicatorController class.
|
|
|
|
deps += [ "//third_party/webrtc/modules/desktop_capture" ]
|
|
|
|
}
|
2018-06-19 18:29:36 +03:00
|
|
|
sources += [
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/browser/api/atom_api_desktop_capturer.cc",
|
|
|
|
"shell/browser/api/atom_api_desktop_capturer.h",
|
2018-06-19 18:29:36 +03:00
|
|
|
]
|
|
|
|
}
|
2018-08-28 20:55:31 +03:00
|
|
|
|
|
|
|
if (enable_view_api) {
|
|
|
|
sources += [
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/browser/api/views/atom_api_box_layout.cc",
|
|
|
|
"shell/browser/api/views/atom_api_box_layout.h",
|
|
|
|
"shell/browser/api/views/atom_api_button.cc",
|
|
|
|
"shell/browser/api/views/atom_api_button.h",
|
|
|
|
"shell/browser/api/views/atom_api_label_button.cc",
|
|
|
|
"shell/browser/api/views/atom_api_label_button.h",
|
|
|
|
"shell/browser/api/views/atom_api_layout_manager.cc",
|
|
|
|
"shell/browser/api/views/atom_api_layout_manager.h",
|
|
|
|
"shell/browser/api/views/atom_api_md_text_button.cc",
|
|
|
|
"shell/browser/api/views/atom_api_md_text_button.h",
|
|
|
|
"shell/browser/api/views/atom_api_resize_area.cc",
|
|
|
|
"shell/browser/api/views/atom_api_resize_area.h",
|
|
|
|
"shell/browser/api/views/atom_api_text_field.cc",
|
|
|
|
"shell/browser/api/views/atom_api_text_field.h",
|
2018-08-28 20:55:31 +03:00
|
|
|
]
|
|
|
|
}
|
2018-08-29 11:39:47 +03:00
|
|
|
|
2018-10-13 04:57:04 +03:00
|
|
|
if (enable_basic_printing) {
|
|
|
|
sources += [
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/browser/printing/print_preview_message_handler.cc",
|
|
|
|
"shell/browser/printing/print_preview_message_handler.h",
|
|
|
|
"shell/renderer/printing/print_render_frame_helper_delegate.cc",
|
|
|
|
"shell/renderer/printing/print_render_frame_helper_delegate.h",
|
2018-10-13 04:57:04 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-08-29 11:39:47 +03:00
|
|
|
if (enable_pepper_flash) {
|
|
|
|
deps += [ "components/pepper_flash" ]
|
|
|
|
}
|
2018-05-04 01:44:29 +03:00
|
|
|
}
|
|
|
|
|
2018-07-18 01:34:19 +03:00
|
|
|
electron_paks("packed_resources") {
|
|
|
|
if (is_mac) {
|
2018-07-27 18:04:03 +03:00
|
|
|
output_dir = "$root_gen_dir/electron_repack"
|
2018-07-18 01:34:19 +03:00
|
|
|
copy_data_to_bundle = true
|
|
|
|
} else {
|
|
|
|
output_dir = root_out_dir
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-04 01:44:29 +03:00
|
|
|
if (is_mac) {
|
2018-09-27 21:53:08 +03:00
|
|
|
electron_framework_name = "$electron_product_name Framework"
|
|
|
|
electron_helper_name = "$electron_product_name Helper"
|
|
|
|
electron_login_helper_name = "$electron_product_name Login Helper"
|
2018-05-04 01:44:29 +03:00
|
|
|
electron_framework_version = "A"
|
|
|
|
|
|
|
|
bundle_data("electron_framework_resources") {
|
|
|
|
public_deps = [
|
2018-07-18 01:34:19 +03:00
|
|
|
":packed_resources",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
2018-07-18 01:34:19 +03:00
|
|
|
sources = []
|
2018-05-04 01:44:29 +03:00
|
|
|
if (icu_use_data_file) {
|
|
|
|
sources += [ "$root_out_dir/icudtl.dat" ]
|
|
|
|
public_deps += [ "//third_party/icu:icudata" ]
|
|
|
|
}
|
|
|
|
if (v8_use_external_startup_data) {
|
2018-06-20 22:50:43 +03:00
|
|
|
sources += [ "$root_out_dir/natives_blob.bin" ]
|
2018-05-04 01:44:29 +03:00
|
|
|
public_deps += [ "//v8" ]
|
2018-06-20 22:50:43 +03:00
|
|
|
if (use_v8_context_snapshot) {
|
|
|
|
sources += [ "$root_out_dir/v8_context_snapshot.bin" ]
|
|
|
|
public_deps += [ "//tools/v8_context_snapshot" ]
|
|
|
|
} else {
|
|
|
|
sources += [ "$root_out_dir/snapshot_blob.bin" ]
|
|
|
|
}
|
2018-05-04 01:44:29 +03:00
|
|
|
}
|
|
|
|
outputs = [
|
|
|
|
"{{bundle_resources_dir}}/{{source_file_part}}",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-09-20 01:42:42 +03:00
|
|
|
if (!is_component_build) {
|
2018-08-21 00:02:52 +03:00
|
|
|
bundle_data("electron_framework_libraries") {
|
2018-09-20 01:42:42 +03:00
|
|
|
sources = []
|
|
|
|
public_deps = []
|
|
|
|
if (is_component_ffmpeg) {
|
|
|
|
sources += [ "$root_out_dir/libffmpeg.dylib" ]
|
|
|
|
public_deps += [ "//third_party/ffmpeg:ffmpeg" ]
|
|
|
|
}
|
2018-08-21 00:02:52 +03:00
|
|
|
outputs = [
|
|
|
|
"{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
group("electron_framework_libraries") {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-29 01:43:21 +03:00
|
|
|
bundle_data("electron_crashpad_helper") {
|
2018-05-04 01:44:29 +03:00
|
|
|
sources = [
|
|
|
|
"$root_out_dir/crashpad_handler",
|
|
|
|
]
|
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"{{bundle_resources_dir}}/{{source_file_part}}",
|
|
|
|
]
|
|
|
|
|
|
|
|
public_deps = [
|
|
|
|
"//third_party/crashpad/crashpad/handler:crashpad_handler",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
mac_framework_bundle("electron_framework") {
|
|
|
|
output_name = electron_framework_name
|
|
|
|
framework_version = electron_framework_version
|
2018-10-01 23:00:53 +03:00
|
|
|
framework_contents = [
|
|
|
|
"Resources",
|
|
|
|
"Libraries",
|
|
|
|
]
|
2018-07-31 01:55:41 +03:00
|
|
|
public_deps = [
|
|
|
|
":electron_lib",
|
|
|
|
]
|
2018-05-04 01:44:29 +03:00
|
|
|
deps = [
|
2018-08-21 00:02:52 +03:00
|
|
|
":electron_framework_libraries",
|
2018-08-29 11:39:47 +03:00
|
|
|
":electron_framework_resources",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
2018-06-29 01:43:21 +03:00
|
|
|
if (!is_mas_build) {
|
|
|
|
deps += [ ":electron_crashpad_helper" ]
|
|
|
|
}
|
2019-06-19 23:46:59 +03:00
|
|
|
info_plist = "shell/common/resources/mac/Info.plist"
|
2018-09-27 21:53:08 +03:00
|
|
|
|
2019-01-12 04:00:43 +03:00
|
|
|
electron_version = read_file("ELECTRON_VERSION", "trim string")
|
2018-09-06 00:00:37 +03:00
|
|
|
extra_substitutions = [
|
2019-06-18 01:56:15 +03:00
|
|
|
"ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.framework",
|
2018-09-06 00:00:37 +03:00
|
|
|
"ELECTRON_VERSION=$electron_version",
|
|
|
|
]
|
2018-05-04 01:44:29 +03:00
|
|
|
|
2018-07-31 01:55:41 +03:00
|
|
|
include_dirs = [ "." ]
|
2018-09-09 04:15:32 +03:00
|
|
|
sources = filenames.framework_sources
|
2018-05-04 01:44:29 +03:00
|
|
|
|
|
|
|
libs = [
|
2018-12-04 18:54:13 +03:00
|
|
|
"AVFoundation.framework",
|
2018-05-04 01:44:29 +03:00
|
|
|
"Carbon.framework",
|
2019-02-14 05:36:28 +03:00
|
|
|
"LocalAuthentication.framework",
|
2018-05-04 01:44:29 +03:00
|
|
|
"QuartzCore.framework",
|
|
|
|
"Quartz.framework",
|
|
|
|
"Security.framework",
|
|
|
|
"SecurityInterface.framework",
|
|
|
|
"ServiceManagement.framework",
|
|
|
|
"StoreKit.framework",
|
|
|
|
]
|
2019-04-18 00:10:04 +03:00
|
|
|
|
|
|
|
if (enable_osr) {
|
|
|
|
libs += [ "IOSurface.framework" ]
|
|
|
|
}
|
|
|
|
|
2018-05-04 01:44:29 +03:00
|
|
|
ldflags = [
|
2018-07-31 01:55:41 +03:00
|
|
|
"-F",
|
|
|
|
rebase_path("external_binaries", root_build_dir),
|
2018-05-04 01:44:29 +03:00
|
|
|
"-Wl,-install_name,@rpath/$output_name.framework/$output_name",
|
|
|
|
"-rpath",
|
|
|
|
"@loader_path/Libraries",
|
|
|
|
]
|
|
|
|
if (is_component_build) {
|
|
|
|
ldflags += [
|
|
|
|
"-rpath",
|
2018-07-31 01:55:41 +03:00
|
|
|
"@executable_path/../../../../../..",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mac_app_bundle("electron_helper_app") {
|
|
|
|
output_name = electron_helper_name
|
2018-07-31 01:55:41 +03:00
|
|
|
deps = [
|
|
|
|
":electron_framework+link",
|
|
|
|
]
|
2019-02-14 20:48:17 +03:00
|
|
|
if (!is_mas_build) {
|
|
|
|
deps += [ "//sandbox/mac:seatbelt" ]
|
|
|
|
}
|
2018-12-13 03:01:10 +03:00
|
|
|
defines = [ "HELPER_EXECUTABLE" ]
|
2018-09-09 04:15:32 +03:00
|
|
|
sources = filenames.app_sources
|
2019-06-19 23:46:59 +03:00
|
|
|
sources += [ "shell/common/atom_constants.cc" ]
|
2018-05-04 01:44:29 +03:00
|
|
|
include_dirs = [ "." ]
|
2019-06-19 23:46:59 +03:00
|
|
|
info_plist = "shell/renderer/resources/mac/Info.plist"
|
2019-06-18 01:56:15 +03:00
|
|
|
extra_substitutions =
|
|
|
|
[ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.helper" ]
|
2018-05-04 01:44:29 +03:00
|
|
|
ldflags = [
|
|
|
|
"-rpath",
|
|
|
|
"@executable_path/../../..",
|
|
|
|
]
|
2018-12-13 03:01:10 +03:00
|
|
|
if (is_component_build) {
|
|
|
|
ldflags += [
|
|
|
|
"-rpath",
|
|
|
|
"@executable_path/../../../../../..",
|
|
|
|
]
|
|
|
|
}
|
2018-05-04 01:44:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bundle_data("electron_app_framework_bundle_data") {
|
|
|
|
sources = [
|
|
|
|
"$root_out_dir/$electron_framework_name.framework",
|
|
|
|
"$root_out_dir/$electron_helper_name.app",
|
|
|
|
]
|
2018-06-29 01:43:21 +03:00
|
|
|
if (!is_mas_build) {
|
|
|
|
sources += [
|
|
|
|
"external_binaries/Mantle.framework",
|
2018-07-31 01:55:41 +03:00
|
|
|
"external_binaries/ReactiveCocoa.framework",
|
|
|
|
"external_binaries/Squirrel.framework",
|
2018-06-29 01:43:21 +03:00
|
|
|
]
|
|
|
|
}
|
2018-05-04 01:44:29 +03:00
|
|
|
outputs = [
|
|
|
|
"{{bundle_contents_dir}}/Frameworks/{{source_file_part}}",
|
|
|
|
]
|
|
|
|
public_deps = [
|
|
|
|
":electron_framework+link",
|
|
|
|
":electron_helper_app",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-06-29 01:43:21 +03:00
|
|
|
mac_app_bundle("electron_login_helper") {
|
|
|
|
output_name = electron_login_helper_name
|
2018-09-09 04:15:32 +03:00
|
|
|
sources = filenames.login_helper_sources
|
2018-06-29 01:43:21 +03:00
|
|
|
include_dirs = [ "." ]
|
|
|
|
libs = [ "AppKit.framework" ]
|
2019-06-19 23:46:59 +03:00
|
|
|
info_plist = "shell/app/resources/mac/loginhelper-Info.plist"
|
2018-07-31 01:55:41 +03:00
|
|
|
extra_substitutions =
|
2019-06-18 01:56:15 +03:00
|
|
|
[ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.loginhelper" ]
|
2018-06-29 01:43:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bundle_data("electron_login_helper_app") {
|
2018-07-31 01:55:41 +03:00
|
|
|
public_deps = [
|
|
|
|
":electron_login_helper",
|
|
|
|
]
|
|
|
|
sources = [
|
|
|
|
"$root_out_dir/$electron_login_helper_name.app",
|
|
|
|
]
|
|
|
|
outputs = [
|
2018-11-07 07:15:01 +03:00
|
|
|
"{{bundle_contents_dir}}/Library/LoginItems/{{source_file_part}}",
|
2018-07-31 01:55:41 +03:00
|
|
|
]
|
2018-06-29 01:43:21 +03:00
|
|
|
}
|
|
|
|
|
2018-11-15 20:30:45 +03:00
|
|
|
action("electron_app_lproj_dirs") {
|
|
|
|
outputs = []
|
|
|
|
|
|
|
|
foreach(locale, locales_as_mac_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_mac_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_mac_outputs) {
|
|
|
|
public_deps += [ ":electron_app_strings_${locale}_bundle_data" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-04 01:44:29 +03:00
|
|
|
bundle_data("electron_app_resources") {
|
|
|
|
public_deps = [
|
2019-02-05 23:10:15 +03:00
|
|
|
":default_app_asar",
|
2018-11-15 20:30:45 +03:00
|
|
|
":electron_app_strings_bundle_data",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
|
|
|
sources = [
|
2018-05-16 22:51:11 +03:00
|
|
|
"$root_out_dir/resources/default_app.asar",
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/browser/resources/mac/electron.icns",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
|
|
|
outputs = [
|
2018-07-31 01:55:41 +03:00
|
|
|
"{{bundle_resources_dir}}/{{source_file_part}}",
|
2018-05-04 01:44:29 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
mac_app_bundle("electron_app") {
|
|
|
|
output_name = electron_product_name
|
2018-09-09 04:15:32 +03:00
|
|
|
sources = filenames.app_sources
|
2019-06-19 23:46:59 +03:00
|
|
|
sources += [ "shell/common/atom_constants.cc" ]
|
2018-05-04 01:44:29 +03:00
|
|
|
include_dirs = [ "." ]
|
|
|
|
deps = [
|
|
|
|
":electron_app_framework_bundle_data",
|
|
|
|
":electron_app_resources",
|
|
|
|
]
|
2018-06-29 01:43:21 +03:00
|
|
|
if (is_mas_build) {
|
|
|
|
deps += [ ":electron_login_helper_app" ]
|
|
|
|
}
|
2019-06-19 23:46:59 +03:00
|
|
|
info_plist = "shell/browser/resources/mac/Info.plist"
|
2019-06-18 01:56:15 +03:00
|
|
|
electron_version = read_file("ELECTRON_VERSION", "trim string")
|
|
|
|
extra_substitutions = [
|
|
|
|
"ELECTRON_BUNDLE_ID=$electron_mac_bundle_id",
|
|
|
|
"ELECTRON_VERSION=$electron_version",
|
|
|
|
]
|
2018-05-04 01:44:29 +03:00
|
|
|
ldflags = [
|
|
|
|
"-rpath",
|
|
|
|
"@executable_path/../Frameworks",
|
|
|
|
]
|
|
|
|
}
|
2018-06-29 00:58:43 +03:00
|
|
|
} else {
|
|
|
|
windows_manifest("electron_app_manifest") {
|
|
|
|
sources = [
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/browser/resources/win/disable_window_filtering.manifest",
|
|
|
|
"shell/browser/resources/win/dpi_aware.manifest",
|
2018-06-29 00:58:43 +03:00
|
|
|
as_invoker_manifest,
|
|
|
|
common_controls_manifest,
|
|
|
|
default_compatibility_manifest,
|
|
|
|
]
|
|
|
|
}
|
2018-05-16 22:51:11 +03:00
|
|
|
|
|
|
|
executable("electron_app") {
|
|
|
|
output_name = electron_project_name
|
2018-09-09 04:15:32 +03:00
|
|
|
sources = filenames.app_sources
|
2018-05-16 22:51:11 +03:00
|
|
|
include_dirs = [ "." ]
|
|
|
|
deps = [
|
2019-02-05 23:10:15 +03:00
|
|
|
":default_app_asar",
|
2018-06-29 00:58:43 +03:00
|
|
|
":electron_app_manifest",
|
2018-05-16 22:51:11 +03:00
|
|
|
":electron_lib",
|
2018-07-25 23:28:10 +03:00
|
|
|
":packed_resources",
|
2018-06-29 00:58:43 +03:00
|
|
|
"//content:sandbox_helper_win",
|
2019-03-05 08:08:55 +03:00
|
|
|
"//electron/buildflags",
|
2018-07-31 01:55:41 +03:00
|
|
|
"//ui/strings",
|
2018-05-16 22:51:11 +03:00
|
|
|
]
|
2018-06-29 00:58:43 +03:00
|
|
|
|
2018-08-21 20:06:28 +03:00
|
|
|
data = []
|
|
|
|
|
|
|
|
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, locales) {
|
|
|
|
data += [ "$root_out_dir/locales/$locale.pak" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!is_mac) {
|
2018-09-22 04:29:55 +03:00
|
|
|
data += [ "$root_out_dir/resources/default_app.asar" ]
|
2018-08-21 20:06:28 +03:00
|
|
|
}
|
|
|
|
|
2018-06-29 00:58:43 +03:00
|
|
|
public_deps = [
|
|
|
|
"//tools/v8_context_snapshot:v8_context_snapshot",
|
|
|
|
]
|
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
sources += [
|
|
|
|
# TODO: we should be generating our .rc files more like how chrome does
|
2019-06-19 23:46:59 +03:00
|
|
|
"shell/browser/resources/win/atom.ico",
|
|
|
|
"shell/browser/resources/win/atom.rc",
|
|
|
|
"shell/browser/resources/win/resource.h",
|
2018-06-29 00:58:43 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
libs = [
|
2018-07-12 23:26:17 +03:00
|
|
|
"comctl32.lib",
|
2018-06-29 00:58:43 +03:00
|
|
|
"uiautomationcore.lib",
|
2018-07-12 23:26:17 +03:00
|
|
|
"wtsapi32.lib",
|
2018-06-29 00:58:43 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
configs += [ "//build/config/win:windowed" ]
|
|
|
|
|
|
|
|
ldflags = [
|
2018-08-15 00:49:35 +03:00
|
|
|
# Windows 7 doesn't have these DLLs.
|
|
|
|
# TODO: are there other DLLs we need to list here to be win7
|
|
|
|
# compatible?
|
|
|
|
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
|
|
|
|
"/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll",
|
2018-06-29 00:58:43 +03:00
|
|
|
]
|
2018-10-16 03:26:34 +03:00
|
|
|
|
|
|
|
# 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 = [
|
|
|
|
"build/electron.def",
|
|
|
|
]
|
2018-06-29 00:58:43 +03:00
|
|
|
}
|
2018-07-31 01:46:04 +03:00
|
|
|
if (is_linux) {
|
2018-10-04 17:10:48 +03:00
|
|
|
ldflags = [ "-pie" ]
|
|
|
|
|
2018-07-31 01:46:04 +03:00
|
|
|
if (!is_component_build && is_component_ffmpeg) {
|
|
|
|
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
|
|
|
|
}
|
|
|
|
}
|
2018-05-16 22:51:11 +03:00
|
|
|
}
|
|
|
|
}
|
2018-08-18 01:28:00 +03:00
|
|
|
|
2018-08-21 20:06:28 +03:00
|
|
|
template("dist_zip") {
|
|
|
|
_runtime_deps_target = "${target_name}__deps"
|
|
|
|
_runtime_deps_file =
|
2018-08-29 11:39:47 +03:00
|
|
|
"$root_out_dir/gen.runtime/" + get_label_info(target_name, "dir") + "/" +
|
2018-08-21 20:06:28 +03:00
|
|
|
get_label_info(target_name, "name") + ".runtime_deps"
|
|
|
|
|
|
|
|
group(_runtime_deps_target) {
|
2018-08-29 11:39:47 +03:00
|
|
|
forward_variables_from(invoker,
|
|
|
|
[
|
|
|
|
"deps",
|
|
|
|
"data_deps",
|
|
|
|
"data",
|
2019-05-01 03:18:22 +03:00
|
|
|
"testonly",
|
2018-08-29 11:39:47 +03:00
|
|
|
])
|
2018-08-21 20:06:28 +03:00
|
|
|
write_runtime_deps = _runtime_deps_file
|
|
|
|
}
|
|
|
|
|
|
|
|
action(target_name) {
|
|
|
|
script = "//electron/build/zip.py"
|
2018-08-29 11:39:47 +03:00
|
|
|
deps = [
|
|
|
|
":$_runtime_deps_target",
|
|
|
|
]
|
2019-05-01 03:18:22 +03:00
|
|
|
forward_variables_from(invoker,
|
|
|
|
[
|
|
|
|
"outputs",
|
|
|
|
"testonly",
|
|
|
|
])
|
2018-08-29 11:39:47 +03:00
|
|
|
args = rebase_path(outputs + [ _runtime_deps_file ], root_build_dir) + [
|
|
|
|
target_cpu,
|
|
|
|
target_os,
|
|
|
|
]
|
2018-08-21 20:06:28 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
copy("electron_license") {
|
2018-08-29 11:39:47 +03:00
|
|
|
sources = [
|
|
|
|
"LICENSE",
|
|
|
|
]
|
|
|
|
outputs = [
|
|
|
|
"$root_build_dir/{{source_file_part}}",
|
|
|
|
]
|
2018-08-21 20:06:28 +03:00
|
|
|
}
|
|
|
|
copy("chromium_licenses") {
|
2018-08-29 11:39:47 +03:00
|
|
|
deps = [
|
|
|
|
"//components/resources:about_credits",
|
|
|
|
]
|
|
|
|
sources = [
|
|
|
|
"$root_gen_dir/components/resources/about_credits.html",
|
|
|
|
]
|
|
|
|
outputs = [
|
|
|
|
"$root_build_dir/LICENSES.chromium.html",
|
|
|
|
]
|
2018-08-21 20:06:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
group("licenses") {
|
2018-08-29 11:39:47 +03:00
|
|
|
data_deps = [
|
|
|
|
":electron_license",
|
|
|
|
":chromium_licenses",
|
|
|
|
]
|
2018-08-21 20:06:28 +03:00
|
|
|
}
|
|
|
|
|
2018-09-27 21:53:08 +03:00
|
|
|
copy("electron_version") {
|
|
|
|
sources = [
|
2019-01-12 04:00:43 +03:00
|
|
|
"ELECTRON_VERSION",
|
2018-09-27 21:53:08 +03:00
|
|
|
]
|
2018-08-29 11:39:47 +03:00
|
|
|
outputs = [
|
2018-10-03 19:44:51 +03:00
|
|
|
"$root_build_dir/version",
|
2018-08-29 11:39:47 +03:00
|
|
|
]
|
2018-08-21 20:06:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
dist_zip("electron_dist_zip") {
|
2018-08-29 11:39:47 +03:00
|
|
|
data_deps = [
|
|
|
|
":electron_app",
|
|
|
|
":licenses",
|
|
|
|
":electron_version",
|
|
|
|
]
|
2019-03-09 00:10:26 +03:00
|
|
|
if (is_linux) {
|
|
|
|
data_deps += [ "//sandbox/linux:chrome_sandbox" ]
|
|
|
|
}
|
2018-08-29 11:39:47 +03:00
|
|
|
outputs = [
|
|
|
|
"$root_build_dir/dist.zip",
|
|
|
|
]
|
2018-08-21 20:06:28 +03:00
|
|
|
}
|
|
|
|
|
2018-09-20 21:10:10 +03:00
|
|
|
dist_zip("electron_ffmpeg_zip") {
|
|
|
|
data_deps = [
|
|
|
|
"//third_party/ffmpeg",
|
|
|
|
]
|
|
|
|
outputs = [
|
|
|
|
"$root_build_dir/ffmpeg.zip",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-09-20 01:42:42 +03:00
|
|
|
dist_zip("electron_chromedriver_zip") {
|
2019-05-01 03:18:22 +03:00
|
|
|
testonly = true
|
2018-09-20 01:42:42 +03:00
|
|
|
data_deps = [
|
|
|
|
"//chrome/test/chromedriver",
|
|
|
|
":licenses",
|
|
|
|
]
|
|
|
|
outputs = [
|
|
|
|
"$root_build_dir/chromedriver.zip",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-09-25 04:48:49 +03:00
|
|
|
dist_zip("electron_mksnapshot_zip") {
|
|
|
|
data_deps = [
|
|
|
|
"//v8:mksnapshot($v8_snapshot_toolchain)",
|
2018-11-07 01:57:52 +03:00
|
|
|
"//tools/v8_context_snapshot:v8_context_snapshot_generator",
|
2018-09-25 04:48:49 +03:00
|
|
|
":licenses",
|
|
|
|
]
|
|
|
|
outputs = [
|
|
|
|
"$root_build_dir/mksnapshot.zip",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-08-21 20:06:28 +03:00
|
|
|
group("electron") {
|
2018-10-24 03:22:41 +03:00
|
|
|
public_deps = [
|
2018-08-29 11:39:47 +03:00
|
|
|
":electron_app",
|
|
|
|
]
|
2018-08-21 20:06:28 +03:00
|
|
|
}
|