123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011 |
- import("build/asar.gni")
- import("build/npm.gni")
- import("buildflags/buildflags.gni")
- import("electron_paks.gni")
- import("filenames.gni")
- import("//build/config/locales.gni")
- import("//build/config/win/manifest.gni")
- import("//pdf/features.gni")
- import("//services/service_manager/public/service_manifest.gni")
- import("//third_party/ffmpeg/ffmpeg_options.gni")
- import("//tools/grit/grit_rule.gni")
- import("//tools/grit/repack.gni")
- import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
- import("//v8/snapshot_toolchain.gni")
- if (is_mac) {
- import("//build/config/mac/rules.gni")
- import("//third_party/icu/config.gni")
- import("//v8/gni/v8.gni")
- }
- if (is_linux) {
- import("//build/config/linux/pkg_config.gni")
- pkg_config("gio_unix") {
- packages = [ "gio-unix-2.0" ]
- }
- }
- branding = read_file("atom/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 (is_mas_build) {
- assert(is_mac,
- "It doesn't make sense to build a MAS build on a non-mac platform")
- }
- config("branding") {
- defines = [
- "ATOM_PRODUCT_NAME=\"$electron_product_name\"",
- "ATOM_PROJECT_NAME=\"$electron_project_name\"",
- ]
- }
- npm_action("atom_browserify_sandbox") {
- deps = [
- ":atom_js2c_copy",
- ]
- sandbox_args = [
- "lib/sandboxed_renderer/init.js",
- "-r",
- "./lib/sandboxed_renderer/api/exports/electron.js:electron",
- "-r",
- "./lib/sandboxed_renderer/api/exports/fs.js:fs",
- "-r",
- "./lib/sandboxed_renderer/api/exports/os.js:os",
- "-r",
- "./lib/sandboxed_renderer/api/exports/path.js:path",
- "-r",
- "./lib/sandboxed_renderer/api/exports/child_process.js:child_process",
- "-t",
- "aliasify",
- ]
- inputs = [
- "lib/sandboxed_renderer/init.js",
- "lib/sandboxed_renderer/api/exports/electron.js",
- "lib/sandboxed_renderer/api/exports/fs.js",
- "lib/sandboxed_renderer/api/exports/os.js",
- "lib/sandboxed_renderer/api/exports/path.js",
- "lib/sandboxed_renderer/api/exports/child_process.js",
- ]
- outputs = [
- "$target_gen_dir/js2c/preload_bundle.js",
- ]
- script = "browserify"
- args = sandbox_args + [
- "-o",
- rebase_path(outputs[0]),
- ]
- }
- npm_action("atom_browserify_isolated") {
- deps = [
- ":atom_js2c_copy",
- ]
- inputs = [
- "lib/isolated_renderer/init.js",
- ]
- outputs = [
- "$target_gen_dir/js2c/isolated_bundle.js",
- ]
- script = "browserify"
- args = inputs + [
- "-t",
- "aliasify",
- "-o",
- rebase_path(outputs[0]),
- ]
- }
- copy("atom_js2c_copy") {
- sources = [
- "lib/common/asar.js",
- "lib/common/asar_init.js",
- ]
- outputs = [
- "$target_gen_dir/js2c/{{source_file_part}}",
- ]
- }
- action("atom_js2c") {
- deps = [
- ":atom_browserify_isolated",
- ":atom_browserify_sandbox",
- ":atom_js2c_copy",
- ]
- js2c_sources = filenames.js2c_sources
- browserify_sources = [
- "$target_gen_dir/js2c/isolated_bundle.js",
- "$target_gen_dir/js2c/preload_bundle.js",
- ]
- inputs = js2c_sources + browserify_sources
- outputs = [
- "$target_gen_dir/atom_natives.h",
- ]
- script = "tools/js2c.py"
- args = [ rebase_path("//third_party/electron_node") ] +
- rebase_path(outputs, root_build_dir) +
- [ rebase_path("$target_gen_dir/js2c", root_build_dir) ]
- }
- asar("js2asar") {
- sources = filenames.js_sources
- if (enable_desktop_capturer) {
- sources += [
- "lib/browser/desktop-capturer.js",
- "lib/renderer/api/desktop-capturer.js",
- ]
- }
- if (enable_view_api) {
- sources += [
- "lib/browser/api/views/box-layout.js",
- "lib/browser/api/views/button.js",
- "lib/browser/api/views/label-button.js",
- "lib/browser/api/views/layout-manager.js",
- "lib/browser/api/views/text-field.js",
- ]
- }
- outputs = [
- "$root_out_dir/resources/electron.asar",
- ]
- root = "lib"
- }
- asar("app2asar") {
- sources = filenames.default_app_sources
- outputs = [
- "$root_out_dir/resources/default_app.asar",
- ]
- root = "default_app"
- }
- grit("resources") {
- source = "electron_resources.grd"
- outputs = [
- "grit/electron_resources.h",
- "electron_resources.pak",
- ]
- grit_flags = [
- "-E",
- "target_gen_dir=" + rebase_path(target_gen_dir, root_build_dir),
- ]
- deps = [
- ":electron_content_manifest_overlays",
- ]
- output_dir = "$target_gen_dir"
- }
- static_library("electron_lib") {
- configs += [ "//v8:external_startup_data" ]
- configs += [ "//third_party/electron_node:node_internals" ]
- public_configs = [ ":branding" ]
- deps = [
- ":atom_js2c",
- "brightray",
- "buildflags",
- "chromium_src:chrome",
- "native_mate",
- "//base",
- "//base:i18n",
- "//chrome/common",
- "//components/certificate_transparency",
- "//components/net_log",
- "//components/network_session_configurator/common",
- "//components/prefs",
- "//components/viz/service",
- "//content/public/app:both",
- "//content/public/child",
- "//content/public/common:service_names",
- "//gin",
- "//media/mojo/interfaces",
- "//net:net_resources",
- "//ppapi/host",
- "//ppapi/proxy",
- "//ppapi/shared_impl",
- "//services/proxy_resolver:lib",
- "//skia",
- "//third_party/blink/public:blink",
- "//third_party/boringssl",
- "//third_party/electron_node:node_lib",
- "//third_party/leveldatabase",
- "//third_party/libyuv",
- "//third_party/webrtc_overrides:init_webrtc",
- "//third_party/widevine/cdm:headers",
- "//ui/events:dom_keycode_converter",
- "//ui/gl",
- "//ui/views",
- "//v8",
- ]
- # TODO: this requires a visibility patch to chromium src. it would be better
- # to use the publicly-available API, which I think is mojo-based. Once
- # electron switches to using the public API, we can remove this from the deps
- # list and remove the visibility patch from chromium.
- deps += [ "//services/device/wake_lock/power_save_blocker" ]
- include_dirs = [
- "chromium_src",
- ".",
- "$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 = []
- libs = []
- extra_source_filters = []
- if (!is_linux) {
- extra_source_filters += [
- "*\bx/*",
- "*_x11.h",
- "*_x11.cc",
- "*_gtk.h",
- "*_gtk.cc",
- "*\blibrary_loaders/*",
- ]
- }
- if (!is_win) {
- extra_source_filters += [
- "*\bwin_*.h",
- "*\bwin_*.cc",
- ]
- }
- if (!is_posix) {
- extra_source_filters += [
- "*_posix.cc",
- "*_posix.h",
- ]
- }
- if (is_mac) {
- extra_source_filters += [
- "*_views.cc",
- "*_views.h",
- "*\bviews/*",
- "*/autofill_popup.cc",
- "*/autofill_popup.h",
- ]
- }
- set_sources_assignment_filter(
- sources_assignment_filter + extra_source_filters)
- sources = filenames.lib_sources
- set_sources_assignment_filter(sources_assignment_filter)
- sources += [ "$target_gen_dir/atom_natives.h" ]
- if (is_component_build) {
- defines += [ "NODE_SHARED_MODE" ]
- }
- if (enable_fake_location_provider) {
- sources += [
- "atom/browser/fake_location_provider.cc",
- "atom/browser/fake_location_provider.h",
- ]
- }
- if (is_mac) {
- deps += [
- "//third_party/crashpad/crashpad/client",
- "//ui/accelerated_widget_mac",
- ]
- include_dirs += [
- # NOTE(nornagon): other chromium files use the full path to include
- # crashpad; this is just here for compatibility between GN and GYP, so that
- # the #includes can be agnostic about where crashpad is vendored.
- "//third_party/crashpad",
- ]
- if (is_mas_build) {
- deps -= [ "//third_party/crashpad/crashpad/client" ]
- sources += [ "atom/browser/api/atom_api_app_mas.mm" ]
- sources -= [
- "atom/browser/auto_updater_mac.mm",
- "atom/common/crash_reporter/crash_reporter_mac.h",
- "atom/common/crash_reporter/crash_reporter_mac.mm",
- ]
- defines += [ "MAS_BUILD" ]
- } else {
- libs += [
- "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" ]
- }
- }
- if (is_linux) {
- deps += [
- "//build/config/linux/gtk",
- "//chrome/browser/ui/libgtkui",
- "//device/bluetooth",
- "//ui/events/devices/x11",
- "//ui/events/platform/x11",
- "//ui/native_theme",
- "//ui/views/controls/webview",
- "//ui/wm",
- ]
- configs += [ ":gio_unix" ]
- defines += [
- # Disable warnings for g_settings_list_schemas.
- "GLIB_DISABLE_DEPRECATION_WARNINGS",
- ]
- sources += filenames.lib_sources_nss
- }
- if (is_win) {
- libs += [ "dwmapi.lib" ]
- }
- if (is_linux || is_win) {
- deps += [ "//third_party/breakpad:client" ]
- include_dirs += [ "//third_party/breakpad" ]
- }
- if (enable_pdf) {
- deps += [ "//pdf" ]
- }
- if (enable_run_as_node) {
- sources += [
- "atom/app/node_main.cc",
- "atom/app/node_main.h",
- ]
- }
- if (enable_osr) {
- sources += [
- "atom/browser/api/atom_api_web_contents_osr.cc",
- "atom/browser/osr/osr_output_device.cc",
- "atom/browser/osr/osr_output_device.h",
- "atom/browser/osr/osr_render_widget_host_view.cc",
- "atom/browser/osr/osr_render_widget_host_view.h",
- "atom/browser/osr/osr_render_widget_host_view_mac.mm",
- "atom/browser/osr/osr_view_proxy.cc",
- "atom/browser/osr/osr_view_proxy.h",
- "atom/browser/osr/osr_web_contents_view.cc",
- "atom/browser/osr/osr_web_contents_view.h",
- "atom/browser/osr/osr_web_contents_view_mac.mm",
- ]
- deps += [
- "//components/viz/service",
- "//services/viz/public/interfaces",
- "//ui/compositor",
- ]
- }
- if (enable_desktop_capturer) {
- if (is_component_build && is_win) {
- # On windows the implementation relies on unexported
- # DxgiDuplicatorController class.
- deps += [ "//third_party/webrtc/modules/desktop_capture" ]
- }
- sources += [
- "atom/browser/api/atom_api_desktop_capturer.cc",
- "atom/browser/api/atom_api_desktop_capturer.h",
- ]
- }
- if (enable_view_api) {
- sources += [
- "atom/browser/api/views/atom_api_box_layout.cc",
- "atom/browser/api/views/atom_api_box_layout.h",
- "atom/browser/api/views/atom_api_button.cc",
- "atom/browser/api/views/atom_api_button.h",
- "atom/browser/api/views/atom_api_label_button.cc",
- "atom/browser/api/views/atom_api_label_button.h",
- "atom/browser/api/views/atom_api_layout_manager.cc",
- "atom/browser/api/views/atom_api_layout_manager.h",
- "atom/browser/api/views/atom_api_text_field.cc",
- "atom/browser/api/views/atom_api_text_field.h",
- ]
- }
- if (enable_basic_printing) {
- deps += [
- "//chrome/common:mojo_bindings",
- "//chrome/services/printing:lib",
- "//components/printing/browser",
- "//components/printing/common",
- "//components/printing/renderer",
- "//components/services/pdf_compositor/public/cpp:utils",
- "//components/services/pdf_compositor/public/interfaces",
- "//printing",
- ]
- sources += [
- "//chrome/browser/printing/print_job.cc",
- "//chrome/browser/printing/print_job.h",
- "//chrome/browser/printing/print_job_manager.cc",
- "//chrome/browser/printing/print_job_manager.h",
- "//chrome/browser/printing/print_job_worker.cc",
- "//chrome/browser/printing/print_job_worker.h",
- "//chrome/browser/printing/print_preview_message_handler.cc",
- "//chrome/browser/printing/print_preview_message_handler.h",
- "//chrome/browser/printing/print_view_manager_base.cc",
- "//chrome/browser/printing/print_view_manager_base.h",
- "//chrome/browser/printing/print_view_manager_basic.cc",
- "//chrome/browser/printing/print_view_manager_basic.h",
- "//chrome/browser/printing/print_view_manager_common.cc",
- "//chrome/browser/printing/print_view_manager_common.h",
- "//chrome/browser/printing/printer_manager_dialog.h",
- "//chrome/browser/printing/printer_manager_dialog_linux.cc",
- "//chrome/browser/printing/printer_manager_dialog_mac.mm",
- "//chrome/browser/printing/printer_manager_dialog_win.cc",
- "//chrome/browser/printing/printer_query.cc",
- "//chrome/browser/printing/printer_query.h",
- "//chrome/browser/printing/printing_message_filter.cc",
- "//chrome/browser/printing/printing_message_filter.h",
- "//chrome/renderer/prerender/prerender_dispatcher.cc",
- "//chrome/renderer/prerender/prerender_dispatcher.h",
- "//chrome/renderer/prerender/prerender_extra_data.cc",
- "//chrome/renderer/prerender/prerender_extra_data.h",
- "//chrome/renderer/prerender/prerender_helper.cc",
- "//chrome/renderer/prerender/prerender_helper.h",
- "//chrome/renderer/prerender/prerenderer_client.cc",
- "//chrome/renderer/prerender/prerenderer_client.h",
- "//chrome/renderer/printing/chrome_print_render_frame_helper_delegate.cc",
- "//chrome/renderer/printing/chrome_print_render_frame_helper_delegate.h",
- "//electron/atom/browser/atom_print_preview_message_handler.cc",
- "//electron/atom/browser/atom_print_preview_message_handler.h",
- ]
- if (is_win) {
- sources += [
- "//chrome/browser/printing/pdf_to_emf_converter.cc",
- "//chrome/browser/printing/pdf_to_emf_converter.h",
- "//chrome/utility/printing_handler.cc",
- "//chrome/utility/printing_handler.h",
- ]
- }
- }
- if (enable_pepper_flash) {
- deps += [ "components/pepper_flash" ]
- }
- }
- 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 (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 = [
- "atom/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) {
- sources += [ "$root_out_dir/natives_blob.bin" ]
- public_deps += [ "//v8" ]
- 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" ]
- }
- }
- outputs = [
- "{{bundle_resources_dir}}/{{source_file_part}}",
- ]
- }
- if (!is_component_build) {
- bundle_data("electron_framework_libraries") {
- sources = []
- public_deps = []
- if (is_component_ffmpeg) {
- sources += [ "$root_out_dir/libffmpeg.dylib" ]
- public_deps += [ "//third_party/ffmpeg:ffmpeg" ]
- }
- outputs = [
- "{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
- ]
- }
- } else {
- group("electron_framework_libraries") {
- }
- }
- bundle_data("electron_crashpad_helper") {
- 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
- framework_contents = [
- "Resources",
- "Libraries",
- ]
- public_deps = [
- ":electron_lib",
- ]
- deps = [
- ":electron_framework_libraries",
- ":electron_framework_resources",
- ":electron_xibs",
- ]
- if (!is_mas_build) {
- deps += [ ":electron_crashpad_helper" ]
- }
- info_plist = "atom/common/resources/mac/Info.plist"
- electron_version = read_file("VERSION", "trim string")
- extra_substitutions = [
- "ATOM_BUNDLE_ID=$electron_mac_bundle_id.framework",
- "ELECTRON_VERSION=$electron_version",
- ]
- include_dirs = [ "." ]
- sources = filenames.framework_sources
- libs = [
- "Carbon.framework",
- "QuartzCore.framework",
- "Quartz.framework",
- "Security.framework",
- "SecurityInterface.framework",
- "ServiceManagement.framework",
- "StoreKit.framework",
- ]
- ldflags = [
- "-F",
- rebase_path("external_binaries", root_build_dir),
- "-Wl,-install_name,@rpath/$output_name.framework/$output_name",
- "-rpath",
- "@loader_path/Libraries",
- ]
- if (is_component_build) {
- ldflags += [
- "-rpath",
- "@executable_path/../../../../../..",
- ]
- }
- }
- mac_app_bundle("electron_helper_app") {
- output_name = electron_helper_name
- deps = [
- ":electron_framework+link",
- ]
- sources = filenames.app_sources
- include_dirs = [ "." ]
- info_plist = "atom/renderer/resources/mac/Info.plist"
- extra_substitutions = [ "ATOM_BUNDLE_ID=$electron_mac_bundle_id.helper" ]
- ldflags = [
- "-rpath",
- "@executable_path/../../..",
- ]
- }
- bundle_data("electron_app_framework_bundle_data") {
- sources = [
- "$root_out_dir/$electron_framework_name.framework",
- "$root_out_dir/$electron_helper_name.app",
- ]
- if (!is_mas_build) {
- sources += [
- "external_binaries/Mantle.framework",
- "external_binaries/ReactiveCocoa.framework",
- "external_binaries/Squirrel.framework",
- ]
- }
- outputs = [
- "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}",
- ]
- public_deps = [
- ":electron_framework+link",
- ":electron_helper_app",
- ]
- }
- mac_app_bundle("electron_login_helper") {
- output_name = electron_login_helper_name
- sources = filenames.login_helper_sources
- include_dirs = [ "." ]
- libs = [ "AppKit.framework" ]
- info_plist = "atom/app/resources/mac/loginhelper-Info.plist"
- extra_substitutions =
- [ "ATOM_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",
- ]
- }
- bundle_data("electron_app_resources") {
- public_deps = [
- ":app2asar",
- ":js2asar",
- ]
- sources = [
- "$root_out_dir/resources/default_app.asar",
- "$root_out_dir/resources/electron.asar",
- "atom/browser/resources/mac/electron.icns",
- ]
- outputs = [
- "{{bundle_resources_dir}}/{{source_file_part}}",
- ]
- }
- mac_app_bundle("electron_app") {
- output_name = electron_product_name
- sources = filenames.app_sources
- include_dirs = [ "." ]
- deps = [
- ":electron_app_framework_bundle_data",
- ":electron_app_resources",
- ]
- if (is_mas_build) {
- deps += [ ":electron_login_helper_app" ]
- }
- info_plist = "atom/browser/resources/mac/Info.plist"
- extra_substitutions = [ "ATOM_BUNDLE_ID=$electron_mac_bundle_id" ]
- ldflags = [
- "-rpath",
- "@executable_path/../Frameworks",
- ]
- }
- } else {
- windows_manifest("electron_app_manifest") {
- sources = [
- "atom/browser/resources/win/disable_window_filtering.manifest",
- "atom/browser/resources/win/dpi_aware.manifest",
- as_invoker_manifest,
- common_controls_manifest,
- default_compatibility_manifest,
- ]
- }
- executable("electron_app") {
- output_name = electron_project_name
- sources = filenames.app_sources
- include_dirs = [ "." ]
- deps = [
- ":app2asar",
- ":electron_app_manifest",
- ":electron_lib",
- ":js2asar",
- ":packed_resources",
- "//content:sandbox_helper_win",
- "//ui/strings",
- ]
- 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) {
- data += [ "$root_out_dir/resources/default_app.asar" ]
- data += [ "$root_out_dir/resources/electron.asar" ]
- }
- 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
- "atom/browser/resources/win/atom.ico",
- "atom/browser/resources/win/atom.rc",
- "atom/browser/resources/win/resources.h",
- ]
- deps += [
- "//third_party/breakpad:breakpad_handler",
- "//third_party/breakpad:breakpad_sender",
- "//ui/native_theme:native_theme_browser",
- "//ui/shell_dialogs",
- "//ui/views/controls/webview",
- "//ui/wm",
- "//ui/wm/public",
- ]
- libs = [
- "comctl32.lib",
- "uiautomationcore.lib",
- "wtsapi32.lib",
- ]
- configs += [ "//build/config/win:windowed" ]
- ldflags = [
- # 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",
- ]
- # 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",
- ]
- }
- if (is_linux) {
- ldflags = [ "-pie" ]
- if (!is_component_build && is_component_ffmpeg) {
- configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
- }
- }
- }
- }
- group("electron_tests") {
- testonly = true
- deps = [
- ":chromium_browsertests",
- ":chromium_unittests",
- ]
- }
- group("chromium_unittests") {
- testonly = true
- deps = [
- "//base:base_unittests",
- "//cc:cc_unittests",
- "//content/test:content_unittests",
- "//crypto:crypto_unittests",
- "//device:device_unittests",
- "//gin:gin_unittests",
- "//gpu:gpu_unittests",
- "//ipc:ipc_tests",
- "//media:media_unittests",
- "//media/capture:capture_unittests",
- "//media/midi:midi_unittests",
- "//media/mojo:media_mojo_unittests",
- "//mojo:mojo_unittests",
- "//net:net_unittests",
- "//ppapi:ppapi_unittests",
- "//skia:skia_unittests",
- "//sql:sql_unittests",
- "//storage:storage_unittests",
- "//third_party/angle/src/tests:angle_unittests",
- "//third_party/blink/public:all_blink",
- "//third_party/blink/public:test_support",
- "//third_party/leveldatabase:env_chromium_unittests",
- "//ui/base:ui_base_unittests",
- "//ui/compositor:compositor_unittests",
- "//ui/display:display_unittests",
- "//ui/events:events_unittests",
- "//ui/gl:gl_unittests",
- "//url:url_unittests",
- "//url/ipc:url_ipc_unittests",
- "//v8/test/unittests:unittests",
- ]
- if (enable_basic_printing) {
- deps += [ "//printing:printing_unittests" ]
- }
- if (is_linux) {
- deps += [
- "//net:disk_cache_memory_test",
- "//sandbox/linux:sandbox_linux_unittests",
- ]
- if (use_dbus) {
- deps += [ "//dbus:dbus_unittests" ]
- }
- }
- }
- group("chromium_browsertests") {
- testonly = true
- deps = [
- "//content/test:content_browsertests",
- ]
- }
- 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",
- ])
- write_runtime_deps = _runtime_deps_file
- }
- action(target_name) {
- script = "//electron/build/zip.py"
- deps = [
- ":$_runtime_deps_target",
- ]
- forward_variables_from(invoker, [ "outputs" ])
- args = rebase_path(outputs + [ _runtime_deps_file ], root_build_dir) + [
- target_cpu,
- target_os,
- ]
- }
- }
- 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 = [
- ":electron_license",
- ":chromium_licenses",
- ]
- }
- copy("electron_version") {
- sources = [
- "VERSION",
- ]
- outputs = [
- "$root_build_dir/version",
- ]
- }
- dist_zip("electron_dist_zip") {
- data_deps = [
- ":electron_app",
- ":licenses",
- ":electron_version",
- ]
- outputs = [
- "$root_build_dir/dist.zip",
- ]
- }
- dist_zip("electron_ffmpeg_zip") {
- data_deps = [
- "//third_party/ffmpeg",
- ]
- outputs = [
- "$root_build_dir/ffmpeg.zip",
- ]
- }
- dist_zip("electron_chromedriver_zip") {
- data_deps = [
- "//chrome/test/chromedriver",
- ":licenses",
- ]
- outputs = [
- "$root_build_dir/chromedriver.zip",
- ]
- }
- dist_zip("electron_mksnapshot_zip") {
- data_deps = [
- "//v8:mksnapshot($v8_snapshot_toolchain)",
- ":licenses",
- ]
- outputs = [
- "$root_build_dir/mksnapshot.zip",
- ]
- }
- group("electron") {
- deps = [
- ":electron_app",
- ]
- }
- group("electron_content_manifest_overlays") {
- deps = [
- ":electron_content_browser_manifest_overlay",
- ":electron_content_packaged_services_manifest_overlay",
- ]
- }
- service_manifest("electron_content_packaged_services_manifest_overlay") {
- source = "//electron/manifests/electron_content_packaged_services_manifest_overlay.json"
- packaged_services = [ "//services/proxy_resolver:proxy_resolver_manifest" ]
- if (enable_basic_printing) {
- packaged_services += [ "//chrome/services/printing:manifest" ]
- }
- }
- service_manifest("electron_content_browser_manifest_overlay") {
- source = "//electron/manifests/electron_content_browser_manifest_overlay.json"
- }
|