1 import("//build/buildflag_header.gni")
2 import("//chrome/common/features.gni")
3 import("//electron/build/templated_file.gni")
4 import("//electron/buildflags/buildflags.gni")
5 import("//electron/filenames.auto.gni")
6 import("//electron/filenames.gni")
7 import("//extensions/buildflags/buildflags.gni")
8 import("//mojo/public/tools/bindings/mojom.gni")
9 import("//ppapi/buildflags/buildflags.gni")
10 import("//tizen_src/chromium_impl/components/components.gni")
11 import("//tools/grit/grit_rule.gni")
12 import("//tools/grit/repack.gni")
13 import("build/wrt.gni")
14 import("filenames.gni")
16 electron_version = "28.1.0"
19 if (tizen_product_tv) {
22 enable_chrome_extensions = false
25 buildflag_header("buildflags") {
26 header = "buildflags.h"
27 header_dir = "wrt/electron/buildflags"
30 "ENABLE_VIEWS_API=false",
31 "ENABLE_PDF_VIEWER=false",
32 "ENABLE_ELECTRON_EXTENSIONS=$enable_chrome_extensions",
33 "ENABLE_BUILTIN_SPELLCHECKER=false",
34 "OVERRIDE_LOCATION_PROVIDER=false",
38 webpack_build("electron_asar_bundle") {
40 auto_filenames.asar_bundle_deps, ".", "//electron")
42 config_file = "//electron/build/webpack/webpack.config.asar.js"
43 out_file = "$root_gen_dir/electron/js2c/asar_bundle.js"
46 webpack_build("electron_browser_bundle") {
48 auto_filenames.browser_bundle_deps, ".", "//electron")
50 config_file = "//electron/build/webpack/webpack.config.browser.js"
51 out_file = "$root_gen_dir/electron/js2c/browser_init.js"
54 webpack_build("electron_renderer_bundle") {
56 auto_filenames.renderer_bundle_deps, ".", "//electron")
58 config_file = "//electron/build/webpack/webpack.config.renderer.js"
59 out_file = "$root_gen_dir/electron/js2c/renderer_init.js"
62 webpack_build("electron_worker_bundle") {
64 auto_filenames.worker_bundle_deps, ".", "//electron")
66 config_file = "//electron/build/webpack/webpack.config.worker.js"
67 out_file = "$root_gen_dir/electron/js2c/worker_init.js"
70 webpack_build("electron_sandboxed_renderer_bundle") {
72 auto_filenames.sandbox_bundle_deps, ".", "//electron")
74 config_file = "//electron/build/webpack/webpack.config.sandboxed_renderer.js"
75 out_file = "$root_gen_dir/electron/js2c/sandbox_bundle.js"
78 webpack_build("electron_isolated_renderer_bundle") {
80 auto_filenames.isolated_bundle_deps, ".", "//electron")
82 config_file = "//electron/build/webpack/webpack.config.isolated_renderer.js"
83 out_file = "$root_gen_dir/electron/js2c/isolated_bundle.js"
86 webpack_build("electron_utility_bundle") {
88 auto_filenames.utility_bundle_deps, ".", "//electron")
90 config_file = "//electron/build/webpack/webpack.config.utility.js"
91 out_file = "$root_gen_dir/electron/js2c/utility_init.js"
94 action("electron_js2c") {
96 ":electron_asar_bundle",
97 ":electron_browser_bundle",
98 ":electron_isolated_renderer_bundle",
99 ":electron_renderer_bundle",
100 ":electron_sandboxed_renderer_bundle",
101 ":electron_utility_bundle",
102 ":electron_worker_bundle",
106 "$root_gen_dir/electron/js2c/asar_bundle.js",
107 "$root_gen_dir/electron/js2c/browser_init.js",
108 "$root_gen_dir/electron/js2c/isolated_bundle.js",
109 "$root_gen_dir/electron/js2c/renderer_init.js",
110 "$root_gen_dir/electron/js2c/sandbox_bundle.js",
111 "$root_gen_dir/electron/js2c/utility_init.js",
112 "$root_gen_dir/electron/js2c/worker_init.js",
115 inputs = sources + [ "//third_party/electron_node/tools/js2c.py" ]
116 outputs = [ "$root_gen_dir/electron/electron_natives.cc" ]
118 script = "//electron/build/js2c.py"
119 args = [ rebase_path("//third_party/electron_node") ] +
120 rebase_path(outputs, root_build_dir) +
121 rebase_path(sources, root_build_dir)
124 action("generate_config_gypi") {
125 outputs = [ "$root_gen_dir/config.gypi" ]
126 script = "build/generate-config-gypi.py"
127 inputs = [ "//third_party/electron_node/configure.py" ]
128 args = rebase_path(outputs) + [ target_cpu ]
131 grit("electron_resources") {
132 source = "//electron/electron_resources.grd"
135 "grit/electron_resources.h",
136 "electron_resources.pak",
139 # Mojo manifest overlays are generated.
142 "target_gen_dir=" + rebase_path(target_gen_dir, root_build_dir),
145 deps = [ ":copy_shell_devtools_discovery_page" ]
147 output_dir = "$root_gen_dir/electron"
150 copy("copy_shell_devtools_discovery_page") {
151 sources = [ "//content/shell/resources/shell_devtools_discovery_page.html" ]
152 outputs = [ "$target_gen_dir/shell_devtools_discovery_page.html" ]
155 npm_action("electron_version_args") {
156 script = "generate-version-json"
158 outputs = [ "$root_gen_dir/electron/electron_version.args" ]
160 args = rebase_path(outputs) + [ "$electron_version" ]
162 inputs = [ "//electron/script/generate-version-json.js" ]
165 templated_file("electron_version_header") {
166 deps = [ ":electron_version_args" ]
168 template = "//electron/build/templates/electron_version.tmpl"
169 output = "$root_gen_dir/electron/electron_version.h"
171 args_files = get_target_outputs(":electron_version_args")
174 action("electron_fuses") {
175 script = "//electron/build/fuses/build.py"
177 inputs = [ "//electron/build/fuses/fuses.json5" ]
180 "$root_gen_dir/electron/fuses.h",
181 "$root_gen_dir/electron/fuses.cc",
184 args = rebase_path(outputs)
187 action("electron_generate_node_defines") {
188 script = "//electron/build/generate_node_defines.py"
191 "//third_party/electron_node/src/tracing/trace_event_common.h",
192 "//third_party/electron_node/src/tracing/trace_event.h",
193 "//third_party/electron_node/src/util.h",
197 "$root_gen_dir/electron/push_and_undef_node_defines.h",
198 "$root_gen_dir/electron/pop_node_defines.h",
201 args = [ rebase_path("$root_gen_dir/electron") ] + rebase_path(inputs)
204 grit("wrt_resources") {
205 source = "//wrt/wrt_resources.grd"
207 "enable_extensions=$enable_chrome_extensions",
210 "grit/wrt_resources.h",
213 output_dir = "$target_gen_dir"
216 repack("wrt_packed_resources") {
218 "$root_gen_dir/electron/electron_resources.pak",
219 "$root_gen_dir/wrt/wrt_resources.pak",
222 "//wrt:electron_resources_grit",
223 "//wrt:wrt_resources",
225 if (enable_chrome_extensions) {
227 "$root_gen_dir/chrome/component_extension_resources.pak",
228 "$root_gen_dir/extensions/extensions_browser_resources_100_percent.pak",
229 "$root_gen_dir/extensions/extensions_renderer_resources.pak",
230 "$root_gen_dir/extensions/extensions_resources.pak",
233 "//chrome/browser/resources:component_extension_resources",
234 "//extensions:extensions_resources",
237 output = "$root_out_dir/wrt_resources.pak"
240 mojom("mojo_bindings") {
243 "src/common/wrt.mojom",
246 "//mojo/public/mojom/base",
247 "//ui/gfx/geometry/mojom",
251 config("wrt_config") {
253 "//tizen_src/build:appsvc",
254 "//tizen_src/build:aul",
255 "//tizen_src/build:cynara-client",
256 "//tizen_src/build:capi-appfw-package-manager",
257 "//tizen_src/build:capi-appfw-service-application",
258 "//tizen_src/build:libefl-extension",
259 "//tizen_src/build:launchpad",
260 "//tizen_src/build:libcapi-appfw-app-manager",
261 "//tizen_src/build:libcapi-appfw-application",
262 "//tizen_src/build:libcapi-media-player",
263 "//tizen_src/build:libcapi-system-system-settings",
264 "//tizen_src/build:libecore-wayland",
265 "//tizen_src/build:libnotification",
266 "//tizen_src/build:libwebappenc",
267 "//tizen_src/build:pkgmgr-info",
268 "//tizen_src/build:tizen-extension-client",
269 "//tizen_src/build:uuid",
270 "//tizen_src/build:wayland-client",
271 "//tizen_src/build:wgt-manifest-handlers",
273 if (!ewk_bringup && tizen_atk_support) {
274 configs += [ "//tizen_src/build:libatk" ]
276 if (tizen_product_tv) {
278 "//tizen_src/build:aul-extension",
279 "//tizen_src/build:autoinput",
280 "//tizen_src/build:libcapi-media-camera",
281 "//tizen_src/build:capi-screensaver",
282 "//tizen_src/build:capi-system-display-rotator",
283 "//tizen_src/build:libcapi-system-info",
284 "//tizen_src/build:libcapi-system-sensor",
285 "//tizen_src/build:message-port",
286 "//tizen_src/build:settings-api",
287 "//tizen_src/build:sqlite3",
288 "//tizen_src/build:tvs-api",
289 "//tizen_src/build:ui-gadget-1",
290 "//tizen_src/build:vd-win-util",
292 if (tizen_version >= 70) {
293 configs += [ "//tizen_src/build:capi-boost-tv" ]
297 "//tizen_src/build:capi-appfw-watch-application",
298 "//tizen_src/build:capi-ui-inputmethod",
307 static_library("wrt_lib") {
311 ":electron_generate_node_defines",
313 ":electron_resources",
314 ":electron_version_header",
316 ":wrt_packed_resources",
318 "//chrome/browser:resource_prefetch_predictor_proto",
319 "//chrome/common:buildflags",
320 "//components/crash/core/app",
321 "//components/navigation_interception",
322 "//components/net_log",
323 "//components/network_hints/browser",
324 "//components/network_hints/common:mojo_bindings",
325 "//components/network_hints/renderer",
326 "//components/os_crypt/async/browser",
327 "//components/paint_preview/buildflags",
328 "//components/security_state/content",
329 "//components/services/language_detection/public/mojom",
330 "//components/upload_list",
331 "//electron/shell/common/api:mojo",
332 "//electron/shell/services/node/public/mojom",
333 "//services/proxy_resolver:lib",
334 "//third_party/electron_node:node_lib",
335 "//third_party/webrtc_overrides:webrtc_component",
336 "//tizen_src/chromium_impl/components/xwalk_extensions:mojo_bindings",
341 "//components/embedder_support:browser_util",
342 "//components/proxy_config",
343 "//components/webrtc",
347 "//tizen_src/chromium_impl/components/xwalk_extensions:offload_js_plugin",
348 "//tizen_src/chromium_impl/components/xwalk_extensions:splash_screen_plugin",
349 "//tizen_src/chromium_impl/components/xwalk_extensions:widget_plugin",
353 "//skia:skia_config",
354 "//third_party/electron_node:node_internals",
355 "//third_party/jsoncpp:jsoncpp_config",
356 "//third_party/leveldatabase:leveldb_config",
357 "//third_party/protobuf:protobuf_config",
358 "//tizen_src/chromium_impl/components/xwalk_extensions:xwalk_extension_config",
359 "//v8:external_startup_data",
361 public_configs = [ ":wrt_config" ]
365 "overrides/electron",
367 "//tizen_src/ewk/efl_integration",
369 "$root_gen_dir/electron",
373 "ELECTRON_PRODUCT_NAME=\"WRT\"",
374 "ELECTRON_PROJECT_NAME=\"WRT\"",
375 "ENABLE_CHROME_EXTENSIONS=$enable_chrome_extensions",
378 if (tizen_product_tv) {
380 "CHROMIUM_RO_ROOT_DIR=\"$lib_ro_root_dir\"",
381 "CHROMIUM_UPGRADED_LIB=\"$lib_upgrade_root_dir/lib/$chromium_impl_lib_name\"",
382 "LIB_PATH=\"$lib_dir_path\"",
386 if (tizen_thread_booster_service) {
387 defines += [ "THREAD_BOOSTER_SERVICE" ]
390 sources = wrt_lib_sources + [
391 "//chrome/browser/app_mode/app_mode_utils.cc",
392 "//chrome/browser/app_mode/app_mode_utils.h",
393 "//chrome/browser/browser_features.cc",
394 "//chrome/browser/browser_features.h",
395 "//chrome/browser/browser_process.cc",
396 "//chrome/browser/browser_process.h",
397 "//chrome/browser/devtools/devtools_contents_resizing_strategy.cc",
398 "//chrome/browser/devtools/devtools_contents_resizing_strategy.h",
399 "//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc",
400 "//chrome/browser/devtools/devtools_embedder_message_dispatcher.h",
401 "//chrome/browser/devtools/devtools_file_system_indexer.cc",
402 "//chrome/browser/devtools/devtools_file_system_indexer.h",
403 "//chrome/browser/icon_loader.cc",
404 "//chrome/browser/icon_loader.h",
405 "//chrome/browser/icon_loader_auralinux.cc",
406 "//chrome/browser/icon_manager.cc",
407 "//chrome/browser/icon_manager.h",
408 "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc",
409 "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.h",
410 "//chrome/browser/net/proxy_config_monitor.cc",
411 "//chrome/browser/net/proxy_config_monitor.h",
412 "//chrome/browser/net/proxy_service_factory.cc",
413 "//chrome/browser/net/proxy_service_factory.h",
414 "//chrome/browser/process_singleton.h",
415 "//chrome/browser/process_singleton_posix.cc",
416 "//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc",
417 "//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.h",
418 "//chrome/browser/ui/exclusive_access/exclusive_access_manager.cc",
419 "//chrome/browser/ui/exclusive_access/exclusive_access_manager.h",
420 "//chrome/browser/ui/exclusive_access/fullscreen_controller.cc",
421 "//chrome/browser/ui/exclusive_access/fullscreen_controller.h",
422 "//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.cc",
423 "//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.h",
424 "//chrome/browser/ui/exclusive_access/keyboard_lock_controller.cc",
425 "//chrome/browser/ui/exclusive_access/keyboard_lock_controller.h",
426 "//chrome/browser/ui/exclusive_access/mouse_lock_controller.cc",
427 "//chrome/browser/ui/exclusive_access/mouse_lock_controller.h",
428 "//electron/shell/browser/certificate_manager_model.cc",
429 "//electron/shell/browser/certificate_manager_model.h",
430 "//electron/shell/browser/lib/power_observer_linux.cc",
431 "//electron/shell/browser/relauncher_linux.cc",
432 "//electron/shell/common/node_bindings_linux.cc",
434 sources += rebase_path(electron_override_sources, ".", "overrides/electron")
435 if (tizen_product_tv) {
436 sources += wrt_lib_sources_tv
438 sources += wrt_lib_sources_unified
440 if (tizen_product_da) {
441 sources += wrt_lib_sources_da
443 if (!ewk_bringup && enable_meerkat) {
444 sources += wrt_lib_sources_edge
446 sources += wrt_lib_sources_mde
447 sources += get_target_outputs(":electron_fuses")
448 sources += xwalk_extensions_sources
450 if (enable_plugins) {
452 "//electron/shell/common/plugin_info.cc",
453 "//electron/shell/common/plugin_info.h",
457 "//electron/shell/renderer/electron_renderer_pepper_host_factory.cc",
458 "//electron/shell/renderer/electron_renderer_pepper_host_factory.h",
459 "//electron/shell/renderer/pepper_helper.cc",
460 "//electron/shell/renderer/pepper_helper.h",
465 if (enable_chrome_extensions) {
467 "//chrome/browser/resources:component_extension_resources",
468 "//electron/shell/browser/extensions/api:api_registration",
469 "//electron/shell/common/extensions/api",
470 "//electron/shell/common/extensions/api:extensions_features",
471 "//extensions/browser",
472 "//extensions/browser:core_api_provider",
473 "//extensions/common",
474 "//extensions/common:core_api_provider",
475 "//extensions/renderer",
477 "//wrt/src/browser/extensions/api:api_registration",
478 "//wrt/src/common/extensions/api",
479 "//wrt/src/common/extensions/api:extensions_features",
481 sources += wrt_lib_sources_chrome_extensions
483 sources += wrt_lib_sources_without_chrome_extensions
486 if (enable_printing) {
488 "//chrome/services/printing:lib",
489 "//chrome/services/printing/public/mojom",
490 "//components/printing/browser",
491 "//components/printing/common:mojo_interfaces",
492 "//components/printing/renderer",
493 "//components/services/print_compositor",
496 "//chrome/browser/bad_message.cc",
497 "//chrome/browser/bad_message.h",
498 "//chrome/browser/printing/print_error_dialog.cc",
499 "//chrome/browser/printing/print_error_dialog.h",
500 "//chrome/browser/printing/print_job.cc",
501 "//chrome/browser/printing/print_job.h",
502 "//chrome/browser/printing/print_job_manager.cc",
503 "//chrome/browser/printing/print_job_manager.h",
504 "//chrome/browser/printing/print_job_worker.cc",
505 "//chrome/browser/printing/print_job_worker.h",
506 "//chrome/browser/printing/print_view_manager_base.cc",
507 "//chrome/browser/printing/print_view_manager_base.h",
508 "//chrome/browser/printing/printer_query.cc",
509 "//chrome/browser/printing/printer_query.h",
510 "//components/printing/browser/print_to_pdf/pdf_print_job.cc",
511 "//components/printing/browser/print_to_pdf/pdf_print_job.h",
512 "//components/printing/browser/print_to_pdf/pdf_print_result.cc",
513 "//components/printing/browser/print_to_pdf/pdf_print_result.h",
514 "//components/printing/browser/print_to_pdf/pdf_print_utils.cc",
515 "//components/printing/browser/print_to_pdf/pdf_print_utils.h",
516 "//electron/shell/browser/printing/print_view_manager_electron.cc",
517 "//electron/shell/browser/printing/print_view_manager_electron.h",
518 "//electron/shell/renderer/printing/print_render_frame_helper_delegate.cc",
519 "//electron/shell/renderer/printing/print_render_frame_helper_delegate.h",
521 if (enable_oop_printing) {
523 "//chrome/browser/printing/print_backend_service_manager.cc",
524 "//chrome/browser/printing/print_backend_service_manager.h",
525 "//chrome/browser/printing/print_job_worker_oop.cc",
526 "//chrome/browser/printing/print_job_worker_oop.h",
529 if (enable_print_preview) {
531 "//chrome/browser/printing/printing_service.cc",
532 "//chrome/browser/printing/printing_service.h",
537 unused_electron_sources = [
538 "shell/browser/api/electron_api_desktop_capturer.cc",
539 "shell/browser/api/electron_api_global_shortcut.cc",
540 "shell/browser/api/electron_api_native_theme.cc",
541 "shell/browser/api/electron_api_safe_storage.cc",
542 "shell/browser/electron_autofill_driver.cc",
543 "shell/browser/electron_autofill_driver_factory.cc",
544 "shell/browser/osr/osr_host_display_client.cc",
545 "shell/browser/osr/osr_render_widget_host_view.cc",
546 "shell/browser/osr/osr_video_consumer.cc",
547 "shell/browser/osr/osr_view_proxy.cc",
548 "shell/browser/osr/osr_web_contents_view.cc",
549 "shell/browser/plugins/plugin_utils.cc",
550 "shell/browser/ui/autofill_popup.cc",
551 "shell/browser/ui/webui/accessibility_ui.cc",
552 "shell/renderer/api/electron_api_spell_check_client.cc",
553 "shell/renderer/electron_autofill_agent.cc",
554 ] + electron_override_sources
556 electron_sources = filenames.lib_sources + filenames.lib_sources_posix
557 if (enable_chrome_extensions) {
558 electron_sources += filenames.lib_sources_extensions
563 "//ui/views/controls/webview",
565 electron_sources += filenames.lib_sources_views
566 unused_electron_sources += [
567 "shell/browser/api/electron_api_menu_views.cc",
568 "shell/browser/native_browser_view_views.cc",
569 "shell/browser/native_window_views.cc",
570 "shell/browser/ui/drag_util_views.cc",
571 "shell/browser/ui/views/autofill_popup_view.cc",
572 "shell/browser/ui/views/inspectable_web_contents_view_views.cc",
576 electron_sources -= unused_electron_sources
577 sources += rebase_path(electron_sources, ".", "//electron")
583 "//tizen_src/ewk/efl_integration:libchromium-ewk",
585 sources = [ "src/app/wrt_main.cc" ]
588 "-Wl,--export-dynamic"
592 configs += [ "//tizen_src/build/config/tizen:executable_config" ]
596 shared_library("wrt-service-override") {
598 "src/common/wrt_service_override.cc"
602 "-Wl,--export-dynamic"
607 executable("wrt-service") {
610 ":wrt-service-override",
611 "//tizen_src/ewk/efl_integration:libchromium-ewk"
614 "src/app/service_main.cc",
615 "src/browser/wrt_ipc.cc",
616 "src/browser/wrt_ipc.h",
620 "//tizen_src/build:appcore-agent",
621 "//tizen_src/build:dbus-1",
622 "//tizen_src/build:dlog",
623 "//tizen_src/build/config/tizen:executable_config",
624 "//tizen_src/chromium_impl/components/xwalk_extensions:xwalk_extension_service_config",
629 executable("wrt-service-launcher") {
632 "src/app/service_launcher_main.cc",
633 "src/browser/wrt_ipc.cc",
634 "src/browser/wrt_ipc.h",
635 "src/service/wrt_service_launcher.cc",
636 "src/service/wrt_service_launcher.h",
639 "//tizen_src/build:bundle",
640 "//tizen_src/build:appcore-agent",
641 "//tizen_src/build:capi-appfw-app-control",
642 "//tizen_src/build:dbus-1",
643 "//tizen_src/build:dlog",
644 "//tizen_src/build:message-port",
645 "//tizen_src/build/config/tizen:executable_config",