BUILD.gn 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406
  1. import("//build/config/locales.gni")
  2. import("//build/config/ui.gni")
  3. import("//build/config/win/manifest.gni")
  4. import("//components/spellcheck/spellcheck_build_features.gni")
  5. import("//content/public/app/mac_helpers.gni")
  6. import("//pdf/features.gni")
  7. import("//printing/buildflags/buildflags.gni")
  8. import("//testing/test.gni")
  9. import("//third_party/ffmpeg/ffmpeg_options.gni")
  10. import("//tools/generate_library_loader/generate_library_loader.gni")
  11. import("//tools/grit/grit_rule.gni")
  12. import("//tools/grit/repack.gni")
  13. import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
  14. import("//v8/gni/snapshot_toolchain.gni")
  15. import("build/asar.gni")
  16. import("build/extract_symbols.gni")
  17. import("build/npm.gni")
  18. import("build/templated_file.gni")
  19. import("build/tsc.gni")
  20. import("build/webpack/webpack.gni")
  21. import("buildflags/buildflags.gni")
  22. import("electron_paks.gni")
  23. import("filenames.auto.gni")
  24. import("filenames.gni")
  25. import("filenames.hunspell.gni")
  26. if (is_mac) {
  27. import("//build/config/mac/rules.gni")
  28. import("//third_party/icu/config.gni")
  29. import("//ui/gl/features.gni")
  30. import("//v8/gni/v8.gni")
  31. import("build/rules.gni")
  32. }
  33. if (is_linux) {
  34. import("//build/config/linux/pkg_config.gni")
  35. pkg_config("gio_unix") {
  36. packages = [ "gio-unix-2.0" ]
  37. }
  38. pkg_config("libnotify_config") {
  39. packages = [
  40. "glib-2.0",
  41. "gdk-pixbuf-2.0",
  42. ]
  43. }
  44. }
  45. branding = read_file("shell/app/BRANDING.json", "json")
  46. electron_project_name = branding.project_name
  47. electron_product_name = branding.product_name
  48. electron_mac_bundle_id = branding.mac_bundle_id
  49. if (is_mas_build) {
  50. assert(is_mac,
  51. "It doesn't make sense to build a MAS build on a non-mac platform")
  52. }
  53. config("branding") {
  54. defines = [
  55. "ELECTRON_PRODUCT_NAME=\"$electron_product_name\"",
  56. "ELECTRON_PROJECT_NAME=\"$electron_project_name\"",
  57. ]
  58. }
  59. config("electron_lib_config") {
  60. include_dirs = [ "." ]
  61. }
  62. # We geneate the definitions twice here, once in //electron/electron.d.ts
  63. # and once in $target_gen_dir
  64. # The one in $target_gen_dir is used for the actual TSC build later one
  65. # and the one in //electron/electron.d.ts is used by your IDE (vscode)
  66. # for typescript prompting
  67. npm_action("build_electron_definitions") {
  68. script = "gn-typescript-definitions"
  69. args = [ rebase_path("$target_gen_dir/tsc/typings/electron.d.ts") ]
  70. inputs = auto_filenames.api_docs + [ "yarn.lock" ]
  71. outputs = [
  72. "$target_gen_dir/tsc/typings/electron.d.ts",
  73. ]
  74. }
  75. webpack_build("electron_browser_bundle") {
  76. deps = [
  77. ":build_electron_definitions",
  78. ]
  79. inputs = auto_filenames.browser_bundle_deps
  80. config_file = "//electron/build/webpack/webpack.config.browser.js"
  81. out_file = "$target_gen_dir/js2c/browser_init.js"
  82. }
  83. webpack_build("electron_renderer_bundle") {
  84. deps = [
  85. ":build_electron_definitions",
  86. ]
  87. inputs = auto_filenames.renderer_bundle_deps
  88. config_file = "//electron/build/webpack/webpack.config.renderer.js"
  89. out_file = "$target_gen_dir/js2c/renderer_init.js"
  90. }
  91. webpack_build("electron_worker_bundle") {
  92. deps = [
  93. ":build_electron_definitions",
  94. ]
  95. inputs = auto_filenames.worker_bundle_deps
  96. config_file = "//electron/build/webpack/webpack.config.worker.js"
  97. out_file = "$target_gen_dir/js2c/worker_init.js"
  98. }
  99. webpack_build("electron_sandboxed_renderer_bundle") {
  100. deps = [
  101. ":build_electron_definitions",
  102. ]
  103. inputs = auto_filenames.sandbox_bundle_deps
  104. config_file = "//electron/build/webpack/webpack.config.sandboxed_renderer.js"
  105. out_file = "$target_gen_dir/js2c/sandbox_bundle.js"
  106. }
  107. webpack_build("electron_isolated_renderer_bundle") {
  108. deps = [
  109. ":build_electron_definitions",
  110. ]
  111. inputs = auto_filenames.isolated_bundle_deps
  112. config_file = "//electron/build/webpack/webpack.config.isolated_renderer.js"
  113. out_file = "$target_gen_dir/js2c/isolated_bundle.js"
  114. }
  115. webpack_build("electron_content_script_bundle") {
  116. deps = [
  117. ":build_electron_definitions",
  118. ]
  119. inputs = auto_filenames.content_script_bundle_deps
  120. config_file = "//electron/build/webpack/webpack.config.content_script.js"
  121. out_file = "$target_gen_dir/js2c/content_script_bundle.js"
  122. }
  123. copy("electron_js2c_copy") {
  124. sources = [
  125. "lib/common/asar.js",
  126. "lib/common/asar_init.js",
  127. ]
  128. outputs = [
  129. "$target_gen_dir/js2c/{{source_file_part}}",
  130. ]
  131. }
  132. action("electron_js2c") {
  133. deps = [
  134. ":electron_browser_bundle",
  135. ":electron_content_script_bundle",
  136. ":electron_isolated_renderer_bundle",
  137. ":electron_js2c_copy",
  138. ":electron_renderer_bundle",
  139. ":electron_sandboxed_renderer_bundle",
  140. ":electron_worker_bundle",
  141. ]
  142. webpack_sources = [
  143. "$target_gen_dir/js2c/browser_init.js",
  144. "$target_gen_dir/js2c/renderer_init.js",
  145. "$target_gen_dir/js2c/worker_init.js",
  146. "$target_gen_dir/js2c/content_script_bundle.js",
  147. "$target_gen_dir/js2c/isolated_bundle.js",
  148. "$target_gen_dir/js2c/sandbox_bundle.js",
  149. ]
  150. sources = webpack_sources + [
  151. "$target_gen_dir/js2c/asar.js",
  152. "$target_gen_dir/js2c/asar_init.js",
  153. ]
  154. inputs = sources + [ "//third_party/electron_node/tools/js2c.py" ]
  155. outputs = [
  156. "$root_gen_dir/electron_natives.cc",
  157. ]
  158. script = "tools/js2c.py"
  159. args = [ rebase_path("//third_party/electron_node") ] +
  160. rebase_path(outputs, root_build_dir) +
  161. rebase_path(sources, root_build_dir)
  162. }
  163. target_gen_default_app_js = "$target_gen_dir/js/default_app"
  164. typescript_build("default_app_js") {
  165. deps = [
  166. ":build_electron_definitions",
  167. ]
  168. type_root = rebase_path("$target_gen_dir/tsc/electron/typings")
  169. sources = filenames.default_app_ts_sources
  170. output_gen_dir = target_gen_default_app_js
  171. output_dir_name = "default_app"
  172. tsconfig = "tsconfig.default_app.json"
  173. }
  174. copy("default_app_static") {
  175. sources = filenames.default_app_static_sources
  176. outputs = [
  177. "$target_gen_default_app_js/{{source}}",
  178. ]
  179. }
  180. copy("default_app_octicon_deps") {
  181. sources = filenames.default_app_octicon_sources
  182. outputs = [
  183. "$target_gen_default_app_js/electron/default_app/octicon/{{source_file_part}}",
  184. ]
  185. }
  186. asar("default_app_asar") {
  187. deps = [
  188. ":default_app_js",
  189. ":default_app_octicon_deps",
  190. ":default_app_static",
  191. ]
  192. root = "$target_gen_default_app_js/electron/default_app"
  193. sources = get_target_outputs(":default_app_js") +
  194. get_target_outputs(":default_app_static") +
  195. get_target_outputs(":default_app_octicon_deps")
  196. outputs = [
  197. "$root_out_dir/resources/default_app.asar",
  198. ]
  199. }
  200. grit("resources") {
  201. source = "electron_resources.grd"
  202. outputs = [
  203. "grit/electron_resources.h",
  204. "electron_resources.pak",
  205. ]
  206. # Mojo manifest overlays are generated.
  207. source_is_generated = true
  208. grit_flags = [
  209. "-E",
  210. "target_gen_dir=" + rebase_path(target_gen_dir, root_build_dir),
  211. ]
  212. deps = [
  213. ":copy_shell_devtools_discovery_page",
  214. ]
  215. output_dir = "$target_gen_dir"
  216. }
  217. copy("copy_shell_devtools_discovery_page") {
  218. sources = [
  219. "//content/shell/resources/shell_devtools_discovery_page.html",
  220. ]
  221. outputs = [
  222. "$target_gen_dir/shell_devtools_discovery_page.html",
  223. ]
  224. }
  225. if (is_linux) {
  226. generate_library_loader("libnotify_loader") {
  227. name = "LibNotifyLoader"
  228. output_h = "libnotify_loader.h"
  229. output_cc = "libnotify_loader.cc"
  230. header = "<libnotify/notify.h>"
  231. config = ":libnotify_config"
  232. functions = [
  233. "notify_is_initted",
  234. "notify_init",
  235. "notify_get_server_caps",
  236. "notify_get_server_info",
  237. "notify_notification_new",
  238. "notify_notification_add_action",
  239. "notify_notification_set_image_from_pixbuf",
  240. "notify_notification_set_timeout",
  241. "notify_notification_set_urgency",
  242. "notify_notification_set_hint_string",
  243. "notify_notification_show",
  244. "notify_notification_close",
  245. ]
  246. }
  247. }
  248. source_set("manifests") {
  249. sources = [
  250. "//electron/shell/app/manifests.cc",
  251. "//electron/shell/app/manifests.h",
  252. ]
  253. include_dirs = [ "//electron" ]
  254. deps = [
  255. "//electron/shell/common/api:mojo",
  256. "//printing/buildflags",
  257. "//services/service_manager/public/cpp",
  258. ]
  259. }
  260. npm_action("electron_version_args") {
  261. script = "generate-version-json"
  262. outputs = [
  263. "$target_gen_dir/electron_version.args",
  264. ]
  265. args = rebase_path(outputs)
  266. inputs = [
  267. "ELECTRON_VERSION",
  268. "script/generate-version-json.js",
  269. ]
  270. }
  271. templated_file("electron_version_header") {
  272. deps = [
  273. ":electron_version_args",
  274. ]
  275. template = "build/templates/electron_version.tmpl"
  276. output = "$target_gen_dir/electron_version.h"
  277. args_files = get_target_outputs(":electron_version_args")
  278. }
  279. source_set("electron_lib") {
  280. configs += [ "//v8:external_startup_data" ]
  281. configs += [ "//third_party/electron_node:node_internals" ]
  282. public_configs = [
  283. ":branding",
  284. ":electron_lib_config",
  285. ]
  286. deps = [
  287. ":electron_js2c",
  288. ":electron_version_header",
  289. ":manifests",
  290. ":resources",
  291. "buildflags",
  292. "chromium_src:chrome",
  293. "chromium_src:chrome_spellchecker",
  294. "native_mate",
  295. "shell/common/api:mojo",
  296. "//base:base_static",
  297. "//base/allocator:buildflags",
  298. "//chrome/app:command_ids",
  299. "//chrome/app/resources:platform_locale_settings",
  300. "//chrome/services/printing/public/mojom",
  301. "//components/certificate_transparency",
  302. "//components/language/core/browser",
  303. "//components/net_log",
  304. "//components/network_hints/browser",
  305. "//components/network_hints/common:mojo_bindings",
  306. "//components/network_hints/renderer",
  307. "//components/network_session_configurator/common",
  308. "//components/prefs",
  309. "//components/viz/host",
  310. "//components/viz/service",
  311. "//content/public/browser",
  312. "//content/public/child",
  313. "//content/public/common:service_names",
  314. "//content/public/gpu",
  315. "//content/public/renderer",
  316. "//content/public/utility",
  317. "//device/bluetooth",
  318. "//device/bluetooth/public/cpp",
  319. "//gin",
  320. "//media/capture/mojom:video_capture",
  321. "//media/mojo/mojom",
  322. "//net:extras",
  323. "//net:net_resources",
  324. "//ppapi/host",
  325. "//ppapi/proxy",
  326. "//ppapi/shared_impl",
  327. "//printing/buildflags",
  328. "//services/device/public/cpp/geolocation",
  329. "//services/device/public/mojom",
  330. "//services/proxy_resolver:lib",
  331. "//services/video_capture/public/mojom:constants",
  332. "//services/viz/privileged/mojom/compositing",
  333. "//skia",
  334. "//third_party/blink/public:blink",
  335. "//third_party/boringssl",
  336. "//third_party/electron_node:node_lib",
  337. "//third_party/leveldatabase",
  338. "//third_party/libyuv",
  339. "//third_party/webrtc_overrides:webrtc_component",
  340. "//third_party/widevine/cdm:headers",
  341. "//ui/base/idle",
  342. "//ui/events:dom_keycode_converter",
  343. "//ui/gl",
  344. "//ui/native_theme",
  345. "//ui/shell_dialogs",
  346. "//ui/views",
  347. "//v8",
  348. "//v8:v8_libplatform",
  349. ]
  350. public_deps = [
  351. "//base",
  352. "//base:i18n",
  353. "//content/public/app:both",
  354. ]
  355. include_dirs = [
  356. "chromium_src",
  357. ".",
  358. "$target_gen_dir",
  359. # TODO(nornagon): replace usage of SchemeRegistry by an actually exported
  360. # API of blink, then remove this from the include_dirs.
  361. "//third_party/blink/renderer",
  362. ]
  363. defines = [ "V8_DEPRECATION_WARNINGS" ]
  364. libs = []
  365. if (is_linux) {
  366. defines += [ "GDK_DISABLE_DEPRECATION_WARNINGS" ]
  367. }
  368. extra_source_filters = []
  369. if (!is_linux) {
  370. extra_source_filters += [
  371. "*\bx/*",
  372. "*_x11.h",
  373. "*_x11.cc",
  374. "*_gtk.h",
  375. "*_gtk.cc",
  376. "*\blibrary_loaders/*",
  377. ]
  378. }
  379. if (!is_win) {
  380. extra_source_filters += [
  381. "*\bwin_*.h",
  382. "*\bwin_*.cc",
  383. ]
  384. }
  385. if (!is_posix) {
  386. extra_source_filters += [
  387. "*_posix.cc",
  388. "*_posix.h",
  389. ]
  390. }
  391. if (is_mac) {
  392. extra_source_filters += [
  393. "*_views.cc",
  394. "*_views.h",
  395. "*\bviews/*",
  396. ]
  397. }
  398. set_sources_assignment_filter(
  399. sources_assignment_filter + extra_source_filters)
  400. sources = filenames.lib_sources
  401. set_sources_assignment_filter(sources_assignment_filter)
  402. if (is_component_build) {
  403. defines += [ "NODE_SHARED_MODE" ]
  404. }
  405. if (enable_fake_location_provider) {
  406. sources += [
  407. "shell/browser/fake_location_provider.cc",
  408. "shell/browser/fake_location_provider.h",
  409. ]
  410. }
  411. if (is_mac) {
  412. deps += [
  413. "//components/remote_cocoa/app_shim",
  414. "//content/common:mac_helpers",
  415. "//ui/accelerated_widget_mac",
  416. ]
  417. libs = [
  418. "AVFoundation.framework",
  419. "Carbon.framework",
  420. "LocalAuthentication.framework",
  421. "QuartzCore.framework",
  422. "Quartz.framework",
  423. "Security.framework",
  424. "SecurityInterface.framework",
  425. "ServiceManagement.framework",
  426. "StoreKit.framework",
  427. ]
  428. sources += [
  429. "shell/browser/ui/views/autofill_popup_view.cc",
  430. "shell/browser/ui/views/autofill_popup_view.h",
  431. ]
  432. if (is_mas_build) {
  433. sources += [ "shell/browser/api/electron_api_app_mas.mm" ]
  434. sources -= [
  435. "shell/browser/auto_updater_mac.mm",
  436. "shell/common/crash_reporter/crash_reporter_mac.h",
  437. "shell/common/crash_reporter/crash_reporter_mac.mm",
  438. ]
  439. defines += [ "MAS_BUILD" ]
  440. } else {
  441. libs += [
  442. "Squirrel.framework",
  443. "ReactiveCocoa.framework",
  444. "Mantle.framework",
  445. ]
  446. cflags_objcc = [
  447. "-F",
  448. rebase_path("external_binaries", root_build_dir),
  449. ]
  450. # ReactiveCocoa which is used by Squirrel requires using __weak.
  451. cflags_objcc += [ "-fobjc-weak" ]
  452. }
  453. }
  454. if (is_linux) {
  455. deps += [
  456. ":libnotify_loader",
  457. "//build/config/linux/gtk",
  458. "//chrome/browser/ui/libgtkui",
  459. "//dbus",
  460. "//device/bluetooth",
  461. "//third_party/breakpad:client",
  462. "//ui/events/devices/x11",
  463. "//ui/events/platform/x11",
  464. "//ui/views/controls/webview",
  465. "//ui/wm",
  466. ]
  467. configs += [ ":gio_unix" ]
  468. include_dirs += [ "//third_party/breakpad" ]
  469. configs += [ "//build/config/linux:x11" ]
  470. defines += [
  471. # Disable warnings for g_settings_list_schemas.
  472. "GLIB_DISABLE_DEPRECATION_WARNINGS",
  473. ]
  474. sources += filenames.lib_sources_nss
  475. sources += [
  476. "shell/browser/ui/gtk/app_indicator_icon.cc",
  477. "shell/browser/ui/gtk/app_indicator_icon.h",
  478. "shell/browser/ui/gtk/app_indicator_icon_menu.cc",
  479. "shell/browser/ui/gtk/app_indicator_icon_menu.h",
  480. "shell/browser/ui/gtk/gtk_status_icon.cc",
  481. "shell/browser/ui/gtk/gtk_status_icon.h",
  482. "shell/browser/ui/gtk/menu_util.cc",
  483. "shell/browser/ui/gtk/menu_util.h",
  484. "shell/browser/ui/gtk/status_icon.cc",
  485. "shell/browser/ui/gtk/status_icon.h",
  486. "shell/browser/ui/gtk_util.cc",
  487. "shell/browser/ui/gtk_util.h",
  488. ]
  489. }
  490. if (is_win) {
  491. libs += [ "dwmapi.lib" ]
  492. deps += [
  493. "//ui/native_theme:native_theme_browser",
  494. "//ui/views/controls/webview",
  495. "//ui/wm",
  496. "//ui/wm/public",
  497. ]
  498. public_deps += [
  499. "//sandbox/win:sandbox",
  500. "//third_party/crashpad/crashpad/handler",
  501. ]
  502. }
  503. if ((is_mac && !is_mas_build) || is_win) {
  504. sources += [
  505. "shell/common/crash_reporter/crash_reporter_crashpad.cc",
  506. "shell/common/crash_reporter/crash_reporter_crashpad.h",
  507. ]
  508. deps += [ "//third_party/crashpad/crashpad/client" ]
  509. }
  510. if (enable_pdf) {
  511. deps += [ "//pdf" ]
  512. }
  513. if (enable_run_as_node) {
  514. sources += [
  515. "shell/app/node_main.cc",
  516. "shell/app/node_main.h",
  517. ]
  518. }
  519. if (enable_osr) {
  520. sources += [
  521. "shell/browser/osr/osr_host_display_client.cc",
  522. "shell/browser/osr/osr_host_display_client.h",
  523. "shell/browser/osr/osr_host_display_client_mac.mm",
  524. "shell/browser/osr/osr_render_widget_host_view.cc",
  525. "shell/browser/osr/osr_render_widget_host_view.h",
  526. "shell/browser/osr/osr_video_consumer.cc",
  527. "shell/browser/osr/osr_video_consumer.h",
  528. "shell/browser/osr/osr_view_proxy.cc",
  529. "shell/browser/osr/osr_view_proxy.h",
  530. "shell/browser/osr/osr_web_contents_view.cc",
  531. "shell/browser/osr/osr_web_contents_view.h",
  532. "shell/browser/osr/osr_web_contents_view_mac.mm",
  533. ]
  534. deps += [
  535. "//components/viz/service",
  536. "//services/viz/public/mojom",
  537. "//ui/compositor",
  538. ]
  539. }
  540. if (enable_remote_module) {
  541. sources += [
  542. "shell/common/api/remote/object_life_monitor.cc",
  543. "shell/common/api/remote/object_life_monitor.h",
  544. "shell/common/api/remote/remote_callback_freer.cc",
  545. "shell/common/api/remote/remote_callback_freer.h",
  546. "shell/common/api/remote/remote_object_freer.cc",
  547. "shell/common/api/remote/remote_object_freer.h",
  548. ]
  549. }
  550. if (enable_desktop_capturer) {
  551. if (is_component_build && !is_linux) {
  552. # On windows the implementation relies on unexported
  553. # DxgiDuplicatorController class. On macOS the implementation
  554. # relies on unexported webrtc::GetWindowOwnerPid method.
  555. deps += [ "//third_party/webrtc/modules/desktop_capture" ]
  556. }
  557. sources += [
  558. "shell/browser/api/electron_api_desktop_capturer.cc",
  559. "shell/browser/api/electron_api_desktop_capturer.h",
  560. ]
  561. }
  562. if (enable_view_api) {
  563. sources += [
  564. "shell/browser/api/views/electron_api_box_layout.cc",
  565. "shell/browser/api/views/electron_api_box_layout.h",
  566. "shell/browser/api/views/electron_api_button.cc",
  567. "shell/browser/api/views/electron_api_button.h",
  568. "shell/browser/api/views/electron_api_label_button.cc",
  569. "shell/browser/api/views/electron_api_label_button.h",
  570. "shell/browser/api/views/electron_api_layout_manager.cc",
  571. "shell/browser/api/views/electron_api_layout_manager.h",
  572. "shell/browser/api/views/electron_api_md_text_button.cc",
  573. "shell/browser/api/views/electron_api_md_text_button.h",
  574. "shell/browser/api/views/electron_api_resize_area.cc",
  575. "shell/browser/api/views/electron_api_resize_area.h",
  576. "shell/browser/api/views/electron_api_text_field.cc",
  577. "shell/browser/api/views/electron_api_text_field.h",
  578. ]
  579. }
  580. if (enable_basic_printing) {
  581. sources += [
  582. "shell/browser/printing/print_preview_message_handler.cc",
  583. "shell/browser/printing/print_preview_message_handler.h",
  584. "shell/renderer/printing/print_render_frame_helper_delegate.cc",
  585. "shell/renderer/printing/print_render_frame_helper_delegate.h",
  586. ]
  587. }
  588. if (enable_pepper_flash) {
  589. deps += [ "components/pepper_flash" ]
  590. }
  591. public_deps += [ "shell/common/extensions/api:extensions_features" ]
  592. deps += [
  593. "//components/pref_registry",
  594. "//components/user_prefs",
  595. "//extensions/browser",
  596. "//extensions/browser:core_api_provider",
  597. "//extensions/common",
  598. "//extensions/common:core_api_provider",
  599. "//extensions/renderer",
  600. ]
  601. if (enable_electron_extensions) {
  602. sources += filenames.lib_sources_extensions
  603. }
  604. }
  605. electron_paks("packed_resources") {
  606. if (is_mac) {
  607. output_dir = "$root_gen_dir/electron_repack"
  608. copy_data_to_bundle = true
  609. } else {
  610. output_dir = root_out_dir
  611. }
  612. }
  613. if (is_mac) {
  614. electron_framework_name = "$electron_product_name Framework"
  615. electron_helper_name = "$electron_product_name Helper"
  616. electron_login_helper_name = "$electron_product_name Login Helper"
  617. electron_framework_version = "A"
  618. electron_version = read_file("ELECTRON_VERSION", "trim string")
  619. mac_xib_bundle_data("electron_xibs") {
  620. sources = [
  621. "shell/common/resources/mac/MainMenu.xib",
  622. ]
  623. }
  624. bundle_data("electron_framework_resources") {
  625. public_deps = [
  626. ":packed_resources",
  627. ]
  628. sources = []
  629. if (icu_use_data_file) {
  630. sources += [ "$root_out_dir/icudtl.dat" ]
  631. public_deps += [ "//third_party/icu:icudata" ]
  632. }
  633. if (v8_use_external_startup_data) {
  634. public_deps += [ "//v8" ]
  635. if (use_v8_context_snapshot) {
  636. sources += [ "$root_out_dir/v8_context_snapshot.bin" ]
  637. public_deps += [ "//tools/v8_context_snapshot" ]
  638. } else {
  639. sources += [ "$root_out_dir/snapshot_blob.bin" ]
  640. }
  641. }
  642. outputs = [
  643. "{{bundle_resources_dir}}/{{source_file_part}}",
  644. ]
  645. }
  646. if (!is_component_build) {
  647. bundle_data("electron_framework_libraries") {
  648. sources = []
  649. public_deps = []
  650. if (is_component_ffmpeg) {
  651. sources += [ "$root_out_dir/libffmpeg.dylib" ]
  652. public_deps += [ "//third_party/ffmpeg:ffmpeg" ]
  653. }
  654. outputs = [
  655. "{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
  656. ]
  657. }
  658. } else {
  659. group("electron_framework_libraries") {
  660. }
  661. }
  662. if (use_egl) {
  663. # Add the ANGLE .dylibs in the Libraries directory of the Framework.
  664. bundle_data("electron_angle_binaries") {
  665. sources = [
  666. "$root_out_dir/egl_intermediates/libEGL.dylib",
  667. "$root_out_dir/egl_intermediates/libGLESv2.dylib",
  668. ]
  669. outputs = [
  670. "{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
  671. ]
  672. public_deps = [
  673. "//ui/gl:angle_library_copy",
  674. ]
  675. }
  676. # Add the SwiftShader .dylibs in the Libraries directory of the Framework.
  677. bundle_data("electron_swiftshader_binaries") {
  678. sources = [
  679. "$root_out_dir/egl_intermediates/libswiftshader_libEGL.dylib",
  680. "$root_out_dir/egl_intermediates/libswiftshader_libGLESv2.dylib",
  681. ]
  682. outputs = [
  683. "{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
  684. ]
  685. public_deps = [
  686. "//ui/gl:swiftshader_library_copy",
  687. ]
  688. }
  689. }
  690. group("electron_angle_library") {
  691. if (use_egl) {
  692. deps = [
  693. ":electron_angle_binaries",
  694. ]
  695. }
  696. }
  697. group("electron_swiftshader_library") {
  698. if (use_egl) {
  699. deps = [
  700. ":electron_swiftshader_binaries",
  701. ]
  702. }
  703. }
  704. bundle_data("electron_crashpad_helper") {
  705. sources = [
  706. "$root_out_dir/crashpad_handler",
  707. ]
  708. outputs = [
  709. "{{bundle_resources_dir}}/{{source_file_part}}",
  710. ]
  711. public_deps = [
  712. "//third_party/crashpad/crashpad/handler:crashpad_handler",
  713. ]
  714. }
  715. mac_framework_bundle("electron_framework") {
  716. output_name = electron_framework_name
  717. framework_version = electron_framework_version
  718. framework_contents = [
  719. "Resources",
  720. "Libraries",
  721. ]
  722. public_deps = [
  723. ":electron_framework_libraries",
  724. ":electron_lib",
  725. ]
  726. deps = [
  727. ":electron_angle_library",
  728. ":electron_framework_libraries",
  729. ":electron_framework_resources",
  730. ":electron_swiftshader_library",
  731. ":electron_xibs",
  732. ]
  733. if (!is_mas_build) {
  734. deps += [ ":electron_crashpad_helper" ]
  735. }
  736. info_plist = "shell/common/resources/mac/Info.plist"
  737. extra_substitutions = [
  738. "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.framework",
  739. "ELECTRON_VERSION=$electron_version",
  740. ]
  741. include_dirs = [ "." ]
  742. sources = filenames.framework_sources
  743. libs = []
  744. if (enable_osr) {
  745. libs += [ "IOSurface.framework" ]
  746. }
  747. ldflags = [
  748. "-F",
  749. rebase_path("external_binaries", root_build_dir),
  750. "-Wl,-install_name,@rpath/$output_name.framework/$output_name",
  751. "-rpath",
  752. "@loader_path/Libraries",
  753. ]
  754. if (is_component_build) {
  755. ldflags += [
  756. "-rpath",
  757. "@executable_path/../../../../../..",
  758. ]
  759. }
  760. }
  761. template("electron_helper_app") {
  762. mac_app_bundle(target_name) {
  763. assert(defined(invoker.helper_name_suffix))
  764. output_name = electron_helper_name + invoker.helper_name_suffix
  765. deps = [
  766. ":electron_framework+link",
  767. ]
  768. if (!is_mas_build) {
  769. deps += [ "//sandbox/mac:seatbelt" ]
  770. }
  771. defines = [ "HELPER_EXECUTABLE" ]
  772. sources = filenames.app_sources
  773. sources += [ "shell/common/electron_constants.cc" ]
  774. include_dirs = [ "." ]
  775. info_plist = "shell/renderer/resources/mac/Info.plist"
  776. extra_substitutions =
  777. [ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.helper" ]
  778. ldflags = [
  779. "-rpath",
  780. "@executable_path/../../..",
  781. ]
  782. if (is_component_build) {
  783. ldflags += [
  784. "-rpath",
  785. "@executable_path/../../../../../..",
  786. ]
  787. }
  788. }
  789. }
  790. foreach(helper_params, content_mac_helpers) {
  791. _helper_target = helper_params[0]
  792. _helper_bundle_id = helper_params[1]
  793. _helper_suffix = helper_params[2]
  794. electron_helper_app("electron_helper_app_${_helper_target}") {
  795. helper_name_suffix = _helper_suffix
  796. }
  797. }
  798. bundle_data("electron_app_framework_bundle_data") {
  799. sources = [
  800. "$root_out_dir/$electron_framework_name.framework",
  801. ]
  802. if (!is_mas_build) {
  803. sources += [
  804. "external_binaries/Mantle.framework",
  805. "external_binaries/ReactiveCocoa.framework",
  806. "external_binaries/Squirrel.framework",
  807. ]
  808. }
  809. outputs = [
  810. "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}",
  811. ]
  812. public_deps = [
  813. ":electron_framework+link",
  814. ]
  815. foreach(helper_params, content_mac_helpers) {
  816. sources +=
  817. [ "$root_out_dir/${electron_helper_name}${helper_params[2]}.app" ]
  818. public_deps += [ ":electron_helper_app_${helper_params[0]}" ]
  819. }
  820. }
  821. mac_app_bundle("electron_login_helper") {
  822. output_name = electron_login_helper_name
  823. sources = filenames.login_helper_sources
  824. include_dirs = [ "." ]
  825. libs = [ "AppKit.framework" ]
  826. info_plist = "shell/app/resources/mac/loginhelper-Info.plist"
  827. extra_substitutions =
  828. [ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.loginhelper" ]
  829. }
  830. bundle_data("electron_login_helper_app") {
  831. public_deps = [
  832. ":electron_login_helper",
  833. ]
  834. sources = [
  835. "$root_out_dir/$electron_login_helper_name.app",
  836. ]
  837. outputs = [
  838. "{{bundle_contents_dir}}/Library/LoginItems/{{source_file_part}}",
  839. ]
  840. }
  841. action("electron_app_lproj_dirs") {
  842. outputs = []
  843. foreach(locale, locales_as_mac_outputs) {
  844. outputs += [ "$target_gen_dir/app_infoplist_strings/$locale.lproj" ]
  845. }
  846. script = "build/mac/make_locale_dirs.py"
  847. args = rebase_path(outputs)
  848. }
  849. foreach(locale, locales_as_mac_outputs) {
  850. bundle_data("electron_app_strings_${locale}_bundle_data") {
  851. sources = [
  852. "$target_gen_dir/app_infoplist_strings/$locale.lproj",
  853. ]
  854. outputs = [
  855. "{{bundle_resources_dir}}/$locale.lproj",
  856. ]
  857. public_deps = [
  858. ":electron_app_lproj_dirs",
  859. ]
  860. }
  861. }
  862. group("electron_app_strings_bundle_data") {
  863. public_deps = []
  864. foreach(locale, locales_as_mac_outputs) {
  865. public_deps += [ ":electron_app_strings_${locale}_bundle_data" ]
  866. }
  867. }
  868. bundle_data("electron_app_resources") {
  869. public_deps = [
  870. ":default_app_asar",
  871. ":electron_app_strings_bundle_data",
  872. ]
  873. sources = [
  874. "$root_out_dir/resources/default_app.asar",
  875. "shell/browser/resources/mac/electron.icns",
  876. ]
  877. outputs = [
  878. "{{bundle_resources_dir}}/{{source_file_part}}",
  879. ]
  880. }
  881. mac_app_bundle("electron_app") {
  882. output_name = electron_product_name
  883. sources = filenames.app_sources
  884. sources += [ "shell/common/electron_constants.cc" ]
  885. include_dirs = [ "." ]
  886. deps = [
  887. ":electron_app_framework_bundle_data",
  888. ":electron_app_resources",
  889. ]
  890. if (is_mas_build) {
  891. deps += [ ":electron_login_helper_app" ]
  892. }
  893. info_plist = "shell/browser/resources/mac/Info.plist"
  894. extra_substitutions = [
  895. "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id",
  896. "ELECTRON_VERSION=$electron_version",
  897. ]
  898. ldflags = [
  899. "-rpath",
  900. "@executable_path/../Frameworks",
  901. ]
  902. }
  903. if (enable_dsyms) {
  904. extract_symbols("electron_framework_syms") {
  905. binary = "$root_out_dir/$electron_framework_name.framework/Versions/$electron_framework_version/$electron_framework_name"
  906. symbol_dir = "$root_out_dir/breakpad_symbols"
  907. dsym_file = "$root_out_dir/$electron_framework_name.dSYM/Contents/Resources/DWARF/$electron_framework_name"
  908. deps = [
  909. ":electron_framework",
  910. ]
  911. }
  912. foreach(helper_params, content_mac_helpers) {
  913. _helper_target = helper_params[0]
  914. _helper_bundle_id = helper_params[1]
  915. _helper_suffix = helper_params[2]
  916. extract_symbols("electron_helper_syms_${_helper_target}") {
  917. binary = "$root_out_dir/$electron_helper_name${_helper_suffix}.app/Contents/MacOS/$electron_helper_name${_helper_suffix}"
  918. symbol_dir = "$root_out_dir/breakpad_symbols"
  919. dsym_file = "$root_out_dir/$electron_helper_name${_helper_suffix}.dSYM/Contents/Resources/DWARF/$electron_helper_name${_helper_suffix}"
  920. deps = [
  921. ":electron_helper_app_${_helper_target}",
  922. ]
  923. }
  924. }
  925. extract_symbols("electron_app_syms") {
  926. binary = "$root_out_dir/$electron_product_name.app/Contents/MacOS/$electron_product_name"
  927. symbol_dir = "$root_out_dir/breakpad_symbols"
  928. dsym_file = "$root_out_dir/$electron_product_name.dSYM/Contents/Resources/DWARF/$electron_product_name"
  929. deps = [
  930. ":electron_app",
  931. ]
  932. }
  933. extract_symbols("swiftshader_egl_syms") {
  934. binary = "$root_out_dir/libswiftshader_libEGL.dylib"
  935. symbol_dir = "$root_out_dir/breakpad_symbols"
  936. dsym_file = "$root_out_dir/libswiftshader_libEGL.dylib.dSYM/Contents/Resources/DWARF/libswiftshader_libEGL.dylib"
  937. deps = [
  938. "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL",
  939. ]
  940. }
  941. extract_symbols("swiftshader_gles_syms") {
  942. binary = "$root_out_dir/libswiftshader_libGLESv2.dylib"
  943. symbol_dir = "$root_out_dir/breakpad_symbols"
  944. dsym_file = "$root_out_dir/libswiftshader_libGLESv2.dylib.dSYM/Contents/Resources/DWARF/libswiftshader_libGLESv2.dylib"
  945. deps = [
  946. "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
  947. ]
  948. }
  949. extract_symbols("crashpad_handler_syms") {
  950. binary = "$root_out_dir/crashpad_handler"
  951. symbol_dir = "$root_out_dir/breakpad_symbols"
  952. dsym_file = "$root_out_dir/crashpad_handler.dSYM/Contents/Resources/DWARF/crashpad_handler"
  953. deps = [
  954. "//third_party/crashpad/crashpad/handler:crashpad_handler",
  955. ]
  956. }
  957. group("electron_symbols") {
  958. deps = [
  959. ":crashpad_handler_syms",
  960. ":electron_app_syms",
  961. ":electron_framework_syms",
  962. ":swiftshader_egl_syms",
  963. ":swiftshader_gles_syms",
  964. ]
  965. foreach(helper_params, content_mac_helpers) {
  966. _helper_target = helper_params[0]
  967. deps += [ ":electron_helper_syms_${_helper_target}" ]
  968. }
  969. }
  970. } else {
  971. group("electron_symbols") {
  972. }
  973. }
  974. } else {
  975. windows_manifest("electron_app_manifest") {
  976. sources = [
  977. "shell/browser/resources/win/disable_window_filtering.manifest",
  978. "shell/browser/resources/win/dpi_aware.manifest",
  979. as_invoker_manifest,
  980. common_controls_manifest,
  981. default_compatibility_manifest,
  982. ]
  983. }
  984. executable("electron_app") {
  985. output_name = electron_project_name
  986. sources = filenames.app_sources
  987. include_dirs = [ "." ]
  988. deps = [
  989. ":default_app_asar",
  990. ":electron_app_manifest",
  991. ":electron_lib",
  992. ":packed_resources",
  993. "//content:sandbox_helper_win",
  994. "//electron/buildflags",
  995. "//ui/strings",
  996. ]
  997. data = []
  998. data += [ "$root_out_dir/resources.pak" ]
  999. data += [ "$root_out_dir/chrome_100_percent.pak" ]
  1000. if (enable_hidpi) {
  1001. data += [ "$root_out_dir/chrome_200_percent.pak" ]
  1002. }
  1003. foreach(locale, locales) {
  1004. data += [ "$root_out_dir/locales/$locale.pak" ]
  1005. }
  1006. if (!is_mac) {
  1007. data += [ "$root_out_dir/resources/default_app.asar" ]
  1008. }
  1009. public_deps = [
  1010. "//tools/v8_context_snapshot:v8_context_snapshot",
  1011. ]
  1012. if (is_win) {
  1013. sources += [
  1014. # TODO: we should be generating our .rc files more like how chrome does
  1015. "shell/browser/resources/win/atom.rc",
  1016. "shell/browser/resources/win/resource.h",
  1017. ]
  1018. libs = [
  1019. "comctl32.lib",
  1020. "uiautomationcore.lib",
  1021. "wtsapi32.lib",
  1022. ]
  1023. configs += [ "//build/config/win:windowed" ]
  1024. ldflags = [
  1025. # Windows 7 doesn't have these DLLs.
  1026. # TODO: are there other DLLs we need to list here to be win7
  1027. # compatible?
  1028. "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
  1029. "/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll",
  1030. ]
  1031. # This is to support renaming of electron.exe. node-gyp has hard-coded
  1032. # executable names which it will recognise as node. This module definition
  1033. # file claims that the electron executable is in fact named "node.exe",
  1034. # which is one of the executable names that node-gyp recognizes.
  1035. # See https://github.com/nodejs/node-gyp/commit/52ceec3a6d15de3a8f385f43dbe5ecf5456ad07a
  1036. ldflags += [ "/DEF:" + rebase_path("build/electron.def", root_build_dir) ]
  1037. inputs = [
  1038. "shell/browser/resources/win/atom.ico",
  1039. "build/electron.def",
  1040. ]
  1041. }
  1042. if (is_linux) {
  1043. ldflags = [ "-pie" ]
  1044. if (!is_component_build && is_component_ffmpeg) {
  1045. configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
  1046. }
  1047. }
  1048. }
  1049. if (is_official_build) {
  1050. if (is_linux) {
  1051. _target_executable_suffix = ""
  1052. _target_shared_library_suffix = ".so"
  1053. } else if (is_win) {
  1054. _target_executable_suffix = ".exe"
  1055. _target_shared_library_suffix = ".dll"
  1056. }
  1057. extract_symbols("electron_app_symbols") {
  1058. binary = "$root_out_dir/$electron_project_name$_target_executable_suffix"
  1059. symbol_dir = "$root_out_dir/breakpad_symbols"
  1060. deps = [
  1061. ":electron_app",
  1062. ]
  1063. }
  1064. extract_symbols("swiftshader_egl_symbols") {
  1065. binary = "$root_out_dir/swiftshader/libEGL$_target_shared_library_suffix"
  1066. symbol_dir = "$root_out_dir/breakpad_symbols"
  1067. deps = [
  1068. "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL",
  1069. ]
  1070. }
  1071. extract_symbols("swiftshader_gles_symbols") {
  1072. binary =
  1073. "$root_out_dir/swiftshader/libGLESv2$_target_shared_library_suffix"
  1074. symbol_dir = "$root_out_dir/breakpad_symbols"
  1075. deps = [
  1076. "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
  1077. ]
  1078. }
  1079. group("electron_symbols") {
  1080. deps = [
  1081. ":electron_app_symbols",
  1082. ":swiftshader_egl_symbols",
  1083. ":swiftshader_gles_symbols",
  1084. ]
  1085. }
  1086. }
  1087. }
  1088. test("shell_browser_ui_unittests") {
  1089. sources = [
  1090. "//electron/shell/browser/ui/accelerator_util_unittests.cc",
  1091. "//electron/shell/browser/ui/run_all_unittests.cc",
  1092. ]
  1093. configs += [ ":electron_lib_config" ]
  1094. deps = [
  1095. ":electron_lib",
  1096. "//base",
  1097. "//base/test:test_support",
  1098. "//testing/gmock",
  1099. "//testing/gtest",
  1100. "//ui/base",
  1101. "//ui/strings",
  1102. ]
  1103. if (is_mac) {
  1104. # Resolve paths owing to different test executable locations
  1105. ldflags = [
  1106. "-F",
  1107. rebase_path("external_binaries", root_build_dir),
  1108. "-rpath",
  1109. "@loader_path",
  1110. "-rpath",
  1111. "@executable_path/" + rebase_path("external_binaries", root_build_dir),
  1112. ]
  1113. }
  1114. }
  1115. template("dist_zip") {
  1116. _runtime_deps_target = "${target_name}__deps"
  1117. _runtime_deps_file =
  1118. "$root_out_dir/gen.runtime/" + get_label_info(target_name, "dir") + "/" +
  1119. get_label_info(target_name, "name") + ".runtime_deps"
  1120. group(_runtime_deps_target) {
  1121. forward_variables_from(invoker,
  1122. [
  1123. "deps",
  1124. "data_deps",
  1125. "data",
  1126. "testonly",
  1127. ])
  1128. write_runtime_deps = _runtime_deps_file
  1129. }
  1130. action(target_name) {
  1131. script = "//electron/build/zip.py"
  1132. deps = [
  1133. ":$_runtime_deps_target",
  1134. ]
  1135. forward_variables_from(invoker,
  1136. [
  1137. "outputs",
  1138. "testonly",
  1139. ])
  1140. flatten = false
  1141. if (defined(invoker.flatten)) {
  1142. flatten = invoker.flatten
  1143. }
  1144. args = rebase_path(outputs + [ _runtime_deps_file ], root_build_dir) + [
  1145. target_cpu,
  1146. target_os,
  1147. "$flatten",
  1148. ]
  1149. }
  1150. }
  1151. copy("electron_license") {
  1152. sources = [
  1153. "LICENSE",
  1154. ]
  1155. outputs = [
  1156. "$root_build_dir/{{source_file_part}}",
  1157. ]
  1158. }
  1159. copy("chromium_licenses") {
  1160. deps = [
  1161. "//components/resources:about_credits",
  1162. ]
  1163. sources = [
  1164. "$root_gen_dir/components/resources/about_credits.html",
  1165. ]
  1166. outputs = [
  1167. "$root_build_dir/LICENSES.chromium.html",
  1168. ]
  1169. }
  1170. group("licenses") {
  1171. data_deps = [
  1172. ":electron_license",
  1173. ":chromium_licenses",
  1174. ]
  1175. }
  1176. copy("electron_version") {
  1177. sources = [
  1178. "ELECTRON_VERSION",
  1179. ]
  1180. outputs = [
  1181. "$root_build_dir/version",
  1182. ]
  1183. }
  1184. dist_zip("electron_dist_zip") {
  1185. data_deps = [
  1186. ":electron_app",
  1187. ":licenses",
  1188. ":electron_version",
  1189. ]
  1190. if (is_linux) {
  1191. data_deps += [ "//sandbox/linux:chrome_sandbox" ]
  1192. }
  1193. outputs = [
  1194. "$root_build_dir/dist.zip",
  1195. ]
  1196. }
  1197. dist_zip("electron_ffmpeg_zip") {
  1198. data_deps = [
  1199. "//third_party/ffmpeg",
  1200. ]
  1201. outputs = [
  1202. "$root_build_dir/ffmpeg.zip",
  1203. ]
  1204. }
  1205. dist_zip("electron_chromedriver_zip") {
  1206. testonly = true
  1207. data_deps = [
  1208. "//chrome/test/chromedriver",
  1209. ":licenses",
  1210. ]
  1211. outputs = [
  1212. "$root_build_dir/chromedriver.zip",
  1213. ]
  1214. }
  1215. mksnapshot_deps = [
  1216. ":licenses",
  1217. "//tools/v8_context_snapshot:v8_context_snapshot_generator($v8_snapshot_toolchain)",
  1218. "//v8:mksnapshot($v8_snapshot_toolchain)",
  1219. ]
  1220. group("electron_mksnapshot") {
  1221. public_deps = mksnapshot_deps
  1222. }
  1223. dist_zip("electron_mksnapshot_zip") {
  1224. data_deps = mksnapshot_deps
  1225. outputs = [
  1226. "$root_build_dir/mksnapshot.zip",
  1227. ]
  1228. }
  1229. copy("hunspell_dictionaries") {
  1230. sources = hunspell_dictionaries + hunspell_licenses
  1231. outputs = [
  1232. "$target_gen_dir/electron_hunspell/{{source_file_part}}",
  1233. ]
  1234. }
  1235. dist_zip("hunspell_dictionaries_zip") {
  1236. data_deps = [
  1237. ":hunspell_dictionaries",
  1238. ]
  1239. flatten = true
  1240. outputs = [
  1241. "$root_build_dir/hunspell_dictionaries.zip",
  1242. ]
  1243. }
  1244. group("electron") {
  1245. public_deps = [
  1246. ":electron_app",
  1247. ]
  1248. }