1 # Copyright 2014 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/chrome_build.gni")
6 import("//build/config/chromeos/ui_mode.gni")
7 import("//build/config/compiler/compiler.gni")
8 import("//build/config/compiler/pgo/pgo.gni")
9 import("//build/config/features.gni")
10 import("//build/config/locales.gni")
11 import("//build/config/python.gni")
12 import("//build/config/sanitizers/sanitizers.gni")
13 import("//build/config/ui.gni")
14 import("//build/config/win/console_app.gni")
15 import("//build/config/win/manifest.gni")
16 import("//build/toolchain/toolchain.gni")
17 import("//chrome/chrome_paks.gni")
18 import("//chrome/common/features.gni")
19 import("//chrome/process_version_rc_template.gni")
20 import("//components/exo/buildflags.gni")
21 import("//components/gwp_asan/buildflags/buildflags.gni")
22 import("//components/nacl/features.gni")
23 import("//components/optimization_guide/features.gni")
24 import("//extensions/buildflags/buildflags.gni")
25 import("//media/media_options.gni")
26 import("//ppapi/buildflags/buildflags.gni")
27 import("//third_party/blink/public/public_features.gni")
28 import("//third_party/widevine/cdm/widevine.gni")
29 import("//tools/resources/generate_resource_allowlist.gni")
30 import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
31 import("//ui/gl/features.gni")
32 import("//v8/gni/v8.gni")
35 import("//build/config/android/rules.gni")
36 } else if (is_linux || is_chromeos || is_tizen) {
37 import("//build/linux/extract_symbols.gni")
38 import("//build/linux/strip_binary.gni")
40 import("//build/apple/compile_entitlements.gni")
41 import("//build/apple/compile_plist.gni")
42 import("//build/apple/tweak_info_plist.gni")
43 import("//build/compiled_action.gni")
44 import("//build/config/apple/symbols.gni")
45 import("//build/config/mac/mac_sdk.gni")
46 import("//build/config/mac/rules.gni")
47 import("//build/util/branding.gni")
48 import("//chrome/browser/buildflags.gni")
49 import("//chrome/updater/branding.gni")
50 import("//chrome/version.gni")
51 import("//content/public/app/mac_helpers.gni")
52 import("//media/cdm/library_cdm/cdm_paths.gni")
53 import("//third_party/icu/config.gni")
57 # Indicates whether keystone registration framework should be enabled (see
58 # action("keystone_registration_framework") below). There are some tests
59 # where we'd like for it to be disabled. (https://crbug.com/909080)
60 enable_keystone_registration_framework = true
62 # On macOS, `is_chrome_branded` builds that have been signed locally will not
63 # launch because certain entitlements are tied to the official Google code
64 # signing identity. If `include_branded_entitlements` is set to false, these
65 # entitlements will be skipped.
66 include_branded_entitlements = true
69 assert(!is_ios, "Chromium/iOS shouldn't use anything in //chrome")
71 if (is_win && enable_resource_allowlist_generation) {
72 _chrome_resource_allowlist = "$target_gen_dir/chrome_resource_allowlist.txt"
76 action("reorder_imports") {
77 script = "//build/win/reorder-imports.py"
79 # See comment in chrome_dll.gypi in the hardlink_to_output
80 # target for why this cannot be 'initial' like the DLL.
81 inputs = [ "$root_out_dir/initialexe/chrome.exe" ]
83 "$root_out_dir/chrome.exe",
84 "$root_out_dir/chrome.exe.pdb",
88 rebase_path("$root_out_dir/initialexe", root_build_dir),
90 rebase_path("$root_out_dir", root_build_dir),
94 deps = [ ":chrome_initial" ]
98 # This does not currently work. See crbug.com/1311822.
99 # This target exists above chrome and it's main components in the dependency
100 # tree as a central place to put assert_no_deps annotations. Since this depends
101 # on Chrome and the main DLLs it uses, it will transitively assert that those
102 # targets also have no deps on disallowed things.
103 group("assert_no_deps") {
107 deps += [ "//chrome/android:chrome_public_apk" ]
108 } else if (!is_tizen) {
109 deps += [ ":chrome" ]
113 deps += [ ":chrome_dll" ]
116 # This should not pull in installer strings. This is will bloat the binary
117 # for no reason and is easy to mess up. See the comment at the top of
118 # //chrome/installer/util/BUILD.gn.
119 assert_no_deps = [ "//chrome/installer/util:strings" ]
121 if (!is_android && !is_mac) {
123 public_deps = [ ":chrome_initial" ]
124 data_deps = [ ":chrome_initial" ]
126 # Do not add any more deps or data_deps to group("chrome").
127 # Because chrome_initial sets its output name to "chrome", running commands
128 # such as `ninja chrome` causes chrome_initial to be built instead. All
129 # deps and data_deps should be added to the chrome_initial target instead.
130 # Targets added here can only be built by explicitly using //chrome:chrome.
131 # Windows-only deps are OK because chrome_initial uses initialexe/chrome as
132 # the output name for that platform.
133 # See crbug.com/1146571.
135 public_deps += [ ":reorder_imports" ]
136 data_deps += [ ":reorder_imports" ]
140 executable("chrome_initial") {
141 configs -= [ "//build/config/compiler:thinlto_optimize_default" ]
142 configs += [ "//build/config/compiler:thinlto_optimize_max" ]
144 output_name = "initialexe/chrome"
146 output_name = "chrome"
149 # Because the sources list varies so significantly per-platform, generally
150 # each platform lists its own files rather than relying on filtering or
151 # removing unused files.
152 sources = [ "app/chrome_exe_resource.h" ]
156 "//build:chromeos_buildflags",
157 "//printing/buildflags",
159 data = [ "$root_out_dir/resources.pak" ]
162 if (is_chromeos_ash) {
163 data_deps += [ "//sandbox/linux:chrome_sandbox" ]
164 deps += [ "//components/exo/wayland:weston_test_stub" ]
167 if (also_build_lacros_chrome_for_architecture != "") {
168 data_deps += [ "//chrome:chrome(//build/toolchain/cros:lacros_clang)" ]
174 "app/chrome_exe_main_win.cc",
175 "app/delay_load_failure_hook_win.cc",
176 "app/delay_load_failure_hook_win.h",
177 "app/main_dll_loader_win.cc",
178 "app/main_dll_loader_win.h",
179 "common/crash_keys.cc",
180 "common/crash_keys.h",
185 ":chrome_exe_version",
187 ":packed_resources_integrity",
188 ":visual_elements_resources",
190 "//build:branding_buildflags",
191 "//chrome/app:chrome_exe_main_exports",
192 "//chrome/app/version_assembly:chrome_exe_manifest",
193 "//chrome/browser:active_use_util",
194 "//chrome/browser:chrome_process_finder",
195 "//chrome/browser/policy:path_parser",
196 "//chrome/chrome_elf",
197 "//chrome/common:constants",
198 "//chrome/install_static:install_static_util",
199 "//chrome/install_static:secondary_module",
200 "//chrome/installer/util:constants",
201 "//chrome/installer/util:did_run_support",
202 "//components/browser_watcher:browser_watcher_client",
203 "//components/crash/core/app",
204 "//components/crash/core/app:run_as_crashpad_handler",
205 "//components/crash/core/common",
206 "//components/crash/win:chrome_wer",
207 "//components/flags_ui:switches",
208 "//content:sandbox_helper_win",
209 "//content/public/common:static_switches",
211 "//gpu/command_buffer/service",
214 "//sandbox/policy/mojom",
215 "//third_party/breakpad:breakpad_handler",
216 "//third_party/breakpad:breakpad_sender",
217 "//third_party/crashpad/crashpad/util",
221 "//chrome/app/version_assembly:version_assembly_manifest",
222 "//chrome/browser/web_applications/chrome_pwa_launcher",
223 "//chrome/chrome_proxy",
224 "//chrome/elevation_service",
225 "//chrome/notification_helper",
228 defines += [ "CHROME_EXE_MAIN" ]
230 if (win_console_app) {
231 defines += [ "WIN_CONSOLE_APP" ]
233 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself, unless a console build
234 # has been requested.
235 configs -= [ "//build/config/win:console" ]
236 configs += [ "//build/config/win:windowed" ]
240 "//build/config/win:delayloads",
241 "//build/config/win:delayloads_not_for_child_dll",
244 if (current_cpu == "x86") {
245 # Set the initial stack size to 0.5MiB, instead of the 1.5MiB needed by
246 # Chrome's main thread. This saves significant memory on threads (like
247 # those in the Windows thread pool, and others) whose stack size we can
248 # only control through this setting. Because Chrome's main thread needs
249 # a minimum 1.5 MiB stack, the main thread (in 32-bit builds only) uses
250 # fibers to switch to a 1.5 MiB stack before running any other code.
251 ldflags = [ "/STACK:0x80000" ]
253 # Increase the initial stack size. The default is 1MB, this is 8MB.
254 ldflags = [ "/STACK:0x800000" ]
256 } else if (use_aura) {
257 # Non-Windows aura entrypoint.
258 sources += [ "app/chrome_exe_main_aura.cc" ]
261 if (is_linux || is_chromeos || is_fuchsia || is_tizen) {
263 "app/chrome_dll_resource.h",
264 "app/chrome_main.cc",
265 "app/chrome_main_delegate.cc",
266 "app/chrome_main_delegate.h",
270 # On Linux, link the dependencies (libraries) that make up actual
271 # Chromium functionality directly into the executable.
274 # For configuring PartitionAlloc
275 "//base/allocator:buildflags",
277 # For the sampling profiler.
278 "//chrome/common/profiler",
280 # Needed to use the master_preferences functions
281 "//chrome/installer/util:with_no_strings",
282 "//content/public/app",
285 "//headless:headless_shell_lib",
288 public_deps = [ "//chrome/common:buildflags" ]
292 ":xdg_mime", # Needs to be public for installer to consume files.
295 data_deps += [ "//components/crash/core/app:chrome_crashpad_handler" ]
300 # On Chrome OS builds (for both ash-chrome and lacros-chrome), put
301 # priority to the library in the installed directory.
302 # This will avoid conflicting of exposed symbols.
303 if (is_chromeos_device) {
304 ldflags += [ "-L" + rebase_path(root_out_dir) ]
307 # On Chrome OS builds (for both ash-chrome and lacros-chrome), put
308 # a metadata.json file in root directory containing Chrome version.
310 data_deps += [ "//build:version_metadata" ]
313 # Chrome OS debug builds for arm need to pass --long-plt to the linker.
314 # See https://bugs.chromium.org/p/chromium/issues/detail?id=583532
315 if (is_chromeos_ash && is_debug && target_cpu == "arm") {
316 ldflags += [ "-Wl,--long-plt" ]
319 if ((is_linux || is_chromeos_lacros) && !is_component_build &&
321 version_script = "//build/linux/chrome.map"
322 inputs = [ version_script ]
323 ldflags += [ "-Wl,--version-script=" +
324 rebase_path(version_script, root_build_dir) ]
327 if (is_chromeos_ash) {
328 public_deps += [ "//ui/lottie" ]
331 if (is_chromeos_lacros) {
333 "//chromeos/crosapi/cpp:crosapi_constants",
334 "//chromeos/crosapi/mojom",
335 "//chromeos/lacros:lacros_paths",
336 "//chromeos/startup",
342 if (is_chromeos_ash || is_win) {
343 data_deps += [ "//mojo/core:shared_library" ]
346 if (is_chromeos_ash) {
347 data_deps += [ "//mojo/core:shared_libraries_for_arc" ]
348 if (is_chromeos_device) {
349 configs += [ "//build/config/chromeos:print_orderfile" ]
350 configs += [ "//build/config/compiler:chrome_orderfile_config" ]
354 # These files are used by the installer so we need a public dep.
355 public_deps += [ ":packed_resources" ]
357 # The step's output are needed at runtime, so we also need a data_dep.
358 data_deps += [ ":packed_resources" ]
360 # ChromeOS by design is safe to have rpath=$ORIGIN. This simplifies shared
362 if (is_chromeos_ash && !is_component_build) {
363 configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
366 if (is_chromeos_lacros && is_chromeos_device) {
367 configs += [ "//build/lacros:optional_shared_libgcc" ]
371 "//chrome/browser/resources/media/mei_preload:component",
372 "//third_party/widevine/cdm",
375 } # !is_android && !is_mac
378 shared_library("chrome_dll") {
379 configs += [ "//build/config/compiler:wexit_time_destructors" ]
380 configs -= [ "//build/config/compiler:thinlto_optimize_default" ]
381 configs += [ "//build/config/compiler:thinlto_optimize_max" ]
385 "//base/win/dllmain.cc",
386 "app/chrome_main.cc",
387 "app/chrome_main_delegate.cc",
388 "app/chrome_main_delegate.h",
391 output_name = "chrome"
394 ":chrome_dll_manifest",
395 ":chrome_dll_version",
397 "//base/allocator:buildflags",
398 "//chrome/app:chrome_dll_resources",
399 "//chrome/app:command_ids",
400 "//chrome/app/theme:chrome_unscaled_resources",
401 "//chrome/chrome_elf",
402 "//chrome/common:buildflags",
403 "//chrome/common/profiler",
404 "//chrome/install_static:install_static_util",
405 "//chrome/install_static:secondary_module",
406 "//components/browser_watcher:stability_client",
407 "//components/crash/core/app",
408 "//components/policy:generated",
409 "//content/public/app",
411 "//headless:headless_renderer",
412 "//headless:headless_shell_browser_lib",
413 "//net:net_resources",
414 "//ppapi/buildflags",
415 "//sandbox/win:sandbox",
416 "//third_party/cld_3/src/src:cld_3",
421 configs += [ "//build/config/win:delayloads" ]
424 deps += [ "//ui/compositor" ]
428 copy("copy_first_run") {
429 sources = [ "app/FirstRun" ]
430 outputs = [ "$root_out_dir/First Run" ]
433 chrome_helper_name = chrome_product_full_name + " Helper"
434 chrome_framework_name = chrome_product_full_name + " Framework"
435 chrome_framework_version = chrome_version_full
437 verify_dynamic_libraries = !is_component_build && !is_asan
438 if (host_os == "mac") {
439 objdump_path = mac_bin_path
441 objdump_path = rebase_path("$clang_base_path/bin/", root_build_dir)
445 deps = [ ":chrome_app" ]
447 data_deps = [ ":chrome_app" ]
449 if (verify_dynamic_libraries) {
450 deps += [ ":verify_libraries_chrome_app" ]
453 if (is_chrome_branded && is_official_build) {
455 ":chrome_dsym_archive",
461 tweak_info_plist("chrome_app_plist") {
462 info_plist = "app/app-Info.plist"
466 "--bundle_id=$chrome_mac_bundle_id",
468 if (is_chrome_branded) {
469 args += [ "--keystone=1" ]
470 if (current_cpu == "arm64") {
471 args += [ "--keystone-base-tag=arm64" ]
474 args += [ "--keystone=0" ]
476 if (enable_chromium_updater) {
477 args += [ "--privileged_helper_id=$privileged_helper_name" ]
481 mac_app_bundle("chrome_app") {
482 output_name = chrome_product_full_name
484 info_plist_target = ":chrome_app_plist"
485 extra_substitutions = [
486 "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id",
487 "CHROMIUM_SHORT_NAME=$chrome_product_short_name",
488 "CHROMIUM_CREATOR=$chrome_mac_creator_code",
491 sources = [ "app/chrome_exe_main_mac.cc" ]
493 extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
496 ":chrome_app_strings_bundle_data",
498 ":chrome_versioned_bundle_data",
499 "//base/allocator:early_zone_registration_mac",
500 "//build:branding_buildflags",
501 "//chrome/common:buildflags",
502 "//chrome/common:version_header",
505 if (enable_stripping) {
506 # At link time, preserve the global symbols specified in the .exports
507 # file. All other global symbols will be marked as private. The default
508 # //build/config/mac:strip_all config will then remove the remaining
509 # local and debug symbols.
510 ldflags = [ "-Wl,-exported_symbols_list," +
511 rebase_path("app/app.exports", root_build_dir) ]
514 if (is_component_build) {
515 # In a component build, the framework is directly linked to the
516 # executable because dlopen() and loading all the dependent dylibs
517 # is time-consuming, see https://crbug.com/1197495.
518 deps += [ ":chrome_framework+link" ]
519 ldflags = [ "-Wl,-rpath,@executable_path/../Frameworks" ]
521 # The Framework is packaged inside the .app bundle. But when using the
522 # component build, all the dependent shared libraries of :chrome_dll are
523 # not packaged within the framework. This data_deps line makes all of
524 # those dependent libraries runtime dependencies of the .app bundle.
525 # This is a bit of a hack, since GN deliberately terminates its search
526 # for runtime_deps at create_bundle nodes (https://crbug.com/1010347).
527 data_deps = [ ":chrome_framework" ]
530 if (enable_chromium_updater) {
531 deps += [ ":chromium_updater_privileged_helper" ]
535 if (verify_dynamic_libraries) {
536 action("verify_libraries_chrome_app") {
537 script = "//chrome/tools/build/mac/verify_dynamic_libraries.py"
538 inputs = [ "${root_out_dir}/${chrome_product_full_name}.app/Contents/MacOS/${chrome_product_full_name}" ]
539 outputs = [ "$target_out_dir/run_$target_name.stamp" ]
542 rebase_path(outputs[0], root_out_dir),
546 rebase_path(inputs[0], root_out_dir),
548 "/usr/lib/libSystem.B.dylib",
550 deps = [ ":chrome_app" ]
554 compiled_action("chrome_app_strings") {
555 tool = "//chrome/tools/build/mac:infoplist_strings_util"
561 foreach(locale, platform_pak_locales) {
562 if (is_chrome_branded) {
563 _strings_file = "google_chrome_strings"
565 _strings_file = "chromium_strings"
568 inputs += [ "$root_gen_dir/chrome/${_strings_file}_${locale}.pak" ]
571 foreach(locale, locales_as_apple_outputs) {
573 "$target_gen_dir/app_infoplist_strings/$locale.lproj/InfoPlist.strings",
580 "${branding_path_product}_strings",
584 rebase_path("$root_gen_dir/chrome", root_build_dir),
586 rebase_path("$target_gen_dir/app_infoplist_strings", root_build_dir),
589 ] + platform_pak_locales
591 if (is_chrome_branded) {
592 deps = [ "//chrome/app:google_chrome_strings" ]
594 deps = [ "//chrome/app:chromium_strings" ]
598 foreach(locale, locales_as_apple_outputs) {
599 bundle_data("chrome_app_strings_${locale}_bundle_data") {
601 "$target_gen_dir/app_infoplist_strings/$locale.lproj/InfoPlist.strings",
604 [ "{{bundle_resources_dir}}/$locale.lproj/{{source_file_part}}" ]
605 public_deps = [ ":chrome_app_strings" ]
608 group("chrome_app_strings_bundle_data") {
610 foreach(locale, locales_as_apple_outputs) {
611 public_deps += [ ":chrome_app_strings_${locale}_bundle_data" ]
615 bundle_data("chrome_app_icon") {
616 sources = [ "app/theme/$branding_path_component/mac/app.icns" ]
617 outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
620 bundle_data("chrome_resources") {
622 "$root_out_dir/$chrome_mac_bundle_id.manifest",
623 "app/theme/$branding_path_component/mac/document.icns",
624 "browser/ui/cocoa/applescript/scripting.sdef",
626 outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
629 ":chrome_app_strings",
630 "//components/policy:chrome_manifest_bundle",
634 bundle_data("chrome_versioned_bundle_data") {
635 sources = [ "$root_out_dir/$chrome_framework_name.framework" ]
636 outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ]
638 # Before bundling the versioned app components, delete any existing
640 ":clean_up_old_versions",
642 # verify_chrome_framework_order depends on :chrome_framework and, for
643 # non-component builds, will ensure the export symbol table is correct.
644 ":verify_chrome_framework_order",
647 if (enable_widevine_cdm_host_verification) {
648 # The :chrome_framework_widevine_signature target copies into the
649 # :chrome_framework bundle. But because the signing file depends on the
650 # framework itself, that would cause a cyclical dependency. Instead,
651 # this dependency directly copies the file into the framework's
652 # resources directory.
653 public_deps += [ ":chrome_framework_widevine_signature" ]
657 if (enable_chromium_updater) {
658 bundle_data("chromium_updater_privileged_helper") {
659 sources = [ "$root_out_dir/$privileged_helper_name" ]
661 "{{bundle_contents_dir}}/Library/LaunchServices/{{source_file_part}}",
664 public_deps = [ "//chrome/updater/mac:privileged_helper" ]
668 action("clean_up_old_versions") {
669 script = "//chrome/tools/build/mac/clean_up_old_versions.py"
671 _stamp_file = "$root_gen_dir/run_$target_name.stamp"
673 outputs = [ _stamp_file ]
675 _versions_dir = "$root_out_dir/$chrome_product_full_name.app/Contents/Frameworks/$chrome_framework_name.framework/Versions"
679 rebase_path(_versions_dir, root_build_dir),
681 rebase_path(_stamp_file, root_build_dir),
689 tweak_info_plist("chrome_helper_plist") {
690 info_plist = "app/helper-Info.plist"
698 compile_entitlements("entitlements") {
699 entitlements_templates = [ "app/app-entitlements.plist" ]
700 if (is_chrome_branded && include_branded_entitlements) {
701 # These entitlements are bound to the official Google Chrome signing
702 # certificate and will not necessarily work in any other build.
703 entitlements_templates += [ "app/app-entitlements-chrome.plist" ]
705 output_name = "$target_gen_dir/app-entitlements.plist"
707 "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id",
708 "CHROMIUM_TEAM_ID=$chrome_mac_team_id",
710 visibility = [ "//chrome/installer/mac:copies" ]
713 template("chrome_helper_app") {
714 mac_app_bundle(target_name) {
715 assert(defined(invoker.helper_name_suffix))
716 assert(defined(invoker.helper_bundle_id_suffix))
718 output_name = chrome_helper_name + invoker.helper_name_suffix
720 if (defined(invoker.info_plist_target)) {
721 info_plist_target = invoker.info_plist_target
723 info_plist_target = ":chrome_helper_plist"
726 extra_substitutions = [
727 "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id",
728 "CHROMIUM_SHORT_NAME=$chrome_product_short_name",
729 "CHROMIUM_HELPER_SUFFIX=${invoker.helper_name_suffix}",
730 "CHROMIUM_HELPER_BUNDLE_ID_SUFFIX=${invoker.helper_bundle_id_suffix}",
733 sources = [ "app/chrome_exe_main_mac.cc" ]
735 extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
737 defines = [ "HELPER_EXECUTABLE" ]
740 "//base/allocator:early_zone_registration_mac",
741 "//build:branding_buildflags",
742 "//chrome/common:version_header",
743 "//sandbox/mac:seatbelt",
746 if (defined(invoker.deps)) {
752 if (is_component_build) {
753 # In a component build, the framework is directly linked to the
754 # executable because dlopen() and loading all the dependent dylibs
755 # is time-consuming, see https://crbug.com/1197495.
756 deps += [ ":chrome_framework+link_nested" ]
759 # The helper is in Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/X/Helpers/Chromium Helper.app/Contents/MacOS
760 # so set rpath up to the base.
761 "-Wl,-rpath,@loader_path/../../../../../../../../../..",
763 # ... and up to Contents/Frameworks.
764 "-Wl,-rpath,@executable_path/../../../../../../..",
768 if (enable_stripping) {
769 # At link time, preserve the global symbols specified in the .exports
770 # file. All other global symbols will be marked as private. The default
771 # //build/config/mac:strip_all config will then remove the remaining
772 # local and debug symbols.
773 ldflags += [ "-Wl,-exported_symbols_list," +
774 rebase_path("app/app.exports", root_build_dir) ]
779 # The following *_helper_params are added to the ones provided by //content
780 # listed in content_mac_helpers (see //content/public/app/mac_helpers.gni).
781 # These allow //chrome to add custom helper apps in addition to the ones
782 # provided by //content. The params here have the same form as the content
783 # helpers and are defined as a tuple of these elements:
784 # target name - A short name to be used when defining the target for that
786 # bundle ID suffix - A string fragment to append to the CFBundleIdentifier of
788 # app name suffix - A string fragment to append to the outer bundle name as
789 # well as the inner executable. This should be reflected in
790 # the target's output_name.
792 # Helper app to display alert notifications. This is necessary as an app can
793 # only display either banner or alert style notifications and the main app
794 # will display banners.
795 alert_helper_params = [
801 # Merge all helper apps needed by //content and //chrome.
802 chrome_mac_helpers = content_mac_helpers + [ alert_helper_params ]
804 # Create all helper apps required by //content.
805 foreach(helper_params, content_mac_helpers) {
806 chrome_helper_app("chrome_helper_app_${helper_params[0]}") {
807 helper_name_suffix = helper_params[2]
808 helper_bundle_id_suffix = helper_params[1]
812 # Create app for the alert helper manually here as we want to modify the plist
813 # to set the alert style and add the app icon to its resources.
814 tweak_info_plist("chrome_helper_app_alerts_plist") {
815 deps = [ ":chrome_helper_plist" ]
816 info_plists = get_target_outputs(":chrome_helper_plist") +
817 [ "app/helper-alerts-Info.plist" ]
820 # Create and bundle an InfoPlist.strings for the alert helper app.
821 # TODO(crbug.com/1182393): Disambiguate and localize alert helper app name.
822 compile_plist("chrome_helper_app_alerts_plist_strings") {
824 plist_templates = [ "app/helper-alerts-InfoPlist.strings" ]
825 substitutions = [ "CHROMIUM_FULL_NAME=$chrome_product_full_name" ]
826 output_name = "$target_gen_dir/helper_alerts_infoplist_strings/base.lproj/InfoPlist.strings"
828 bundle_data("chrome_helper_app_alerts_resources") {
829 sources = get_target_outputs(":chrome_helper_app_alerts_plist_strings")
830 outputs = [ "{{bundle_resources_dir}}/base.lproj/{{source_file_part}}" ]
831 public_deps = [ ":chrome_helper_app_alerts_plist_strings" ]
834 chrome_helper_app("chrome_helper_app_${alert_helper_params[0]}") {
835 helper_name_suffix = alert_helper_params[2]
836 helper_bundle_id_suffix = alert_helper_params[1]
837 info_plist_target = ":chrome_helper_app_alerts_plist"
840 ":chrome_helper_app_alerts_resources",
844 if (verify_dynamic_libraries) {
845 foreach(helper_params, chrome_mac_helpers) {
846 _helper_target = helper_params[0]
847 _helper_bundle_id = helper_params[1]
848 _helper_suffix = helper_params[2]
850 action("verify_libraries_chrome_helper_app_${_helper_target}") {
851 script = "//chrome/tools/build/mac/verify_dynamic_libraries.py"
852 inputs = [ "${root_out_dir}/${chrome_helper_name}${_helper_suffix}.app/Contents/MacOS/${chrome_helper_name}${_helper_suffix}" ]
853 outputs = [ "$target_out_dir/run_$target_name.stamp" ]
856 rebase_path(outputs[0], root_out_dir),
860 rebase_path(inputs[0], root_out_dir),
862 # Do not --allow more libraries here without consulting with the
863 # security team (security-dev@chromium.org).
865 "/usr/lib/libsandbox.1.dylib",
867 "/usr/lib/libSystem.B.dylib",
869 deps = [ ":chrome_helper_app_${_helper_target}" ]
874 bundle_data("chrome_framework_helpers") {
876 "$root_out_dir/app_mode_loader",
877 "$root_out_dir/chrome_crashpad_handler",
880 outputs = [ "{{bundle_contents_dir}}/Helpers/{{source_file_part}}" ]
883 "//chrome/app_shim:app_mode_loader",
884 "//components/crash/core/app:chrome_crashpad_handler",
887 foreach(helper_params, chrome_mac_helpers) {
889 [ "$root_out_dir/${chrome_helper_name}${helper_params[2]}.app" ]
890 public_deps += [ ":chrome_helper_app_${helper_params[0]}" ]
891 if (verify_dynamic_libraries) {
893 [ ":verify_libraries_chrome_helper_app_${helper_params[0]}" ]
897 if (enable_chromium_updater) {
898 if (is_chrome_branded) {
899 sources += [ "//third_party/updater/chrome_mac_universal_prod/${updater_product_full_name}.app" ]
901 sources += [ "$root_out_dir/${updater_product_full_name}.app" ]
904 "//chrome/updater/mac:browser_install_script",
905 "//chrome/updater/mac:updater_bundle",
906 "//chrome/updater/mac:updater_install_script",
912 bundle_data("chrome_framework_resources") {
914 # This image is used to badge the lock icon in the
915 # authentication dialogs, such as those used for installation
916 # from disk image and Keystone promotion (if so enabled). It
917 # needs to exist as a file on disk and not just something in a
918 # resource bundle because that's the interface that
919 # Authorization Services uses. Also, Authorization Services
920 # can't deal with .icns files.
921 "app/theme/default_100_percent/$branding_path_component/product_logo_32.png",
922 "browser/mac/install.sh",
925 outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
929 "//chrome/app_shim:app_mode_loader_plist_bundle_data",
932 if (is_chrome_branded) {
934 "browser/mac/keystone_promote_postflight.sh",
935 "browser/mac/keystone_promote_preflight.sh",
939 if (icu_use_data_file) {
940 sources += [ "$root_out_dir/icudtl.dat" ]
941 public_deps += [ "//third_party/icu:icudata" ]
944 if (v8_use_external_startup_data) {
945 public_deps += [ "//v8" ]
946 if (use_v8_context_snapshot) {
947 sources += [ "$root_out_dir/$v8_context_snapshot_filename" ]
948 public_deps += [ "//tools/v8_context_snapshot" ]
950 sources += [ "$root_out_dir/snapshot_blob.bin" ]
956 bundle_data("chrome_framework_plugins") {
959 [ "{{bundle_contents_dir}}/Internet Plug-Ins/{{source_file_part}}" ]
963 if (current_cpu == "x86") {
964 sources += [ "$root_out_dir/nacl_irt_x86_32.nexe" ]
965 } else if (current_cpu == "x64") {
966 sources += [ "$root_out_dir/nacl_irt_x86_64.nexe" ]
968 public_deps += [ "//ppapi/native_client:irt" ]
972 group("chrome_framework_plugins") {
976 # EGL on MacOS ships with official chrome
977 bundle_egl_libraries = use_egl
979 if (bundle_egl_libraries) {
980 # Add the ANGLE .dylibs in the MODULE_DIR of Chromium.app
981 bundle_data("angle_binaries") {
983 "$root_out_dir/egl_intermediates/libEGL.dylib",
984 "$root_out_dir/egl_intermediates/libGLESv2.dylib",
986 outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
987 public_deps = [ "//ui/gl:angle_library_copy" ]
990 # Add the SwiftShader .dylibs in the MODULE_DIR of Chromium.app
991 bundle_data("swiftshader_binaries") {
993 "$root_out_dir/vk_intermediates/libvk_swiftshader.dylib",
994 "$root_out_dir/vk_intermediates/vk_swiftshader_icd.json",
996 outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
997 public_deps = [ "//ui/gl:swiftshader_vk_library_copy" ]
1001 group("angle_library") {
1002 if (bundle_egl_libraries) {
1003 deps = [ ":angle_binaries" ]
1007 group("swiftshader_library") {
1008 if (bundle_egl_libraries) {
1009 deps = [ ":swiftshader_binaries" ]
1013 if (bundle_widevine_cdm) {
1014 bundle_data("widevine_cdm_library_binaries") {
1015 sources = [ "$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib" ]
1016 if (enable_widevine_cdm_host_verification) {
1018 [ "$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib.sig" ]
1020 outputs = [ "{{bundle_contents_dir}}/Libraries/$widevine_cdm_path/{{source_file_part}}" ]
1021 public_deps = [ "//third_party/widevine/cdm" ]
1024 bundle_data("widevine_cdm_library_manifest_and_license_files") {
1026 "$root_out_dir/WidevineCdm/LICENSE",
1027 "$root_out_dir/WidevineCdm/manifest.json",
1030 "{{bundle_contents_dir}}/Libraries/WidevineCdm/{{source_file_part}}",
1032 public_deps = [ "//third_party/widevine/cdm" ]
1036 group("widevine_cdm_library") {
1037 if (bundle_widevine_cdm) {
1039 ":widevine_cdm_library_binaries",
1040 ":widevine_cdm_library_manifest_and_license_files",
1045 if (enable_widevine_cdm_host_verification) {
1046 widevine_sign_file("sign_chrome_framework_for_widevine") {
1047 file = "$root_out_dir/$chrome_framework_name.framework/Versions/$chrome_framework_version/$chrome_framework_name"
1049 signature_file = "$root_out_dir/$chrome_framework_name.sig"
1050 deps = [ ":chrome_framework" ]
1053 copy("chrome_framework_widevine_signature") {
1054 deps = [ ":sign_chrome_framework_for_widevine" ]
1056 sources = [ "$root_out_dir/$chrome_framework_name.sig" ]
1058 outputs = [ "$root_out_dir/$chrome_framework_name.framework/Resources/{{source_file_part}}" ]
1062 if (is_chrome_branded && enable_keystone_registration_framework) {
1063 bundle_data("keystone_registration_framework") {
1064 sources = [ "//third_party/googlemac/Releases/Keystone/KeystoneRegistration.framework" ]
1066 outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ]
1069 group("keystone_registration_framework") {
1073 if (build_with_internal_optimization_guide) {
1074 # Add the optimization guide .dylib in the MODULE_DIR of Chromium.app
1075 bundle_data("optimization_guide_library") {
1077 "$root_out_dir/og_intermediates/liboptimization_guide_internal.dylib",
1079 outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
1080 public_deps = [ "//components/optimization_guide/core:optimization_guide_internal_library_copy" ]
1083 group("optimization_guide_library") {
1087 tweak_info_plist("chrome_framework_plist") {
1088 info_plist = "app/framework-Info.plist"
1094 chrome_product_short_name,
1098 # On Mac, speed up the component build by not re-bundling the framework
1099 # every time it changes. Instead, place all the sources and their deps in
1100 # a library that the bundled framework links (and re-exports). That way
1101 # only the library needs to be re-linked when it changes.
1102 if (is_component_build) {
1103 _dll_target_type = "shared_library"
1105 _dll_target_type = "source_set"
1107 target(_dll_target_type, "chrome_dll") {
1109 ":chrome_framework",
1110 ":chrome_framework_create_bundle",
1111 ":chrome_framework_shared_library",
1115 "app/chrome_crash_reporter_client.cc",
1116 "app/chrome_crash_reporter_client.h",
1117 "app/chrome_crash_reporter_client_mac.mm",
1118 "app/chrome_dll_resource.h",
1119 "app/chrome_main.cc",
1120 "app/chrome_main_delegate.cc",
1121 "app/chrome_main_delegate.h",
1122 "app/chrome_main_mac.h",
1123 "app/chrome_main_mac.mm",
1128 "//base/allocator:buildflags",
1129 "//build:chromeos_buildflags",
1130 "//chrome/app:command_ids",
1131 "//chrome/app:notification_metrics",
1132 "//chrome/common:buildflags",
1133 "//chrome/common/profiler",
1134 "//components/crash/core/app",
1135 "//components/policy:generated",
1136 "//content/public/app",
1137 "//headless:headless_shell_lib",
1138 "//third_party/cld_3/src/src:cld_3",
1141 if (is_component_build) {
1142 frameworks = [ "Carbon.framework" ]
1147 "-Wl," + rebase_path("app/framework.order", root_build_dir),
1151 configs += [ "//build/config/compiler:wexit_time_destructors" ]
1154 mac_framework_bundle("chrome_framework") {
1155 output_name = chrome_framework_name
1157 framework_version = chrome_framework_version
1158 framework_contents = [
1164 if (is_chrome_branded) {
1165 framework_contents += [ "Default Apps" ]
1166 if (enable_keystone_registration_framework) {
1167 # For KeystoneRegistration.framework.
1168 framework_contents += [ "Frameworks" ]
1173 framework_contents += [ "Internet Plug-Ins" ]
1176 configs += [ "//build/config/compiler:wexit_time_destructors" ]
1177 configs -= [ "//build/config/compiler:thinlto_optimize_default" ]
1178 configs += [ "//build/config/compiler:thinlto_optimize_max" ]
1180 info_plist_target = ":chrome_framework_plist"
1181 extra_substitutions = [
1182 "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id",
1183 "CHROMIUM_SHORT_NAME=$chrome_product_short_name",
1186 public_deps = [ ":chrome_dll" ]
1190 ":chrome_framework_helpers",
1191 ":chrome_framework_plugins",
1192 ":chrome_framework_resources",
1193 ":keystone_registration_framework",
1194 ":optimization_guide_library",
1195 ":swiftshader_library",
1196 ":widevine_cdm_library",
1197 "//chrome/browser/resources/media/mei_preload:component_bundle",
1200 if (is_chrome_branded) {
1201 bundle_deps += [ ":preinstalled_apps" ]
1205 "-compatibility_version",
1206 chrome_dylib_version,
1208 chrome_dylib_version,
1209 "-Wl,-order_file," + rebase_path("app/framework.order", root_build_dir),
1212 if (!is_component_build) {
1213 # Specify a sensible install_name for static builds. The library is
1214 # dlopen()ed so this is not used to resolve the module.
1215 ldflags += [ "-Wl,-install_name,@executable_path/../Frameworks/$chrome_framework_name.framework/Versions/$chrome_version_full/$chrome_framework_name" ]
1217 # In the component build, both the :chrome_app and various
1218 # :chrome_helper* targets directly link to the Framework target. Use
1219 # @rpath-based loading so that the dylib ID does not have to be changed
1220 # with install_name_tool.
1222 "-Wl,-install_name,@rpath/$chrome_framework_name.framework/$chrome_framework_name",
1223 "-Wl,-rpath,@loader_path/../../../../../..",
1224 "-Wl,-reexport_library,libchrome_dll.dylib",
1227 data_deps = [ ":chrome_dll" ]
1231 _framework_binary_path = "$root_out_dir/$chrome_framework_name.framework/Versions/$chrome_framework_version/$chrome_framework_name"
1232 assert(_framework_binary_path != "",
1233 "Ignore configuration-dependent unused variable warning")
1235 # TOOD(crbug/1163903#c8) - thakis@ look into why profile and coverage
1236 # instrumentation adds these symbols in different orders
1237 if (!is_component_build && chrome_pgo_phase != 1 && !using_sanitizer) {
1238 action("verify_chrome_framework_order") {
1239 script = "//chrome/tools/build/mac/verify_order.py"
1240 stamp_file = "$target_out_dir/run_$target_name.stamp"
1243 "--stamp=" + rebase_path(stamp_file, root_out_dir),
1244 "--binary=" + rebase_path(_framework_binary_path, root_out_dir),
1245 "--symbol-file=" + rebase_path("app/framework.order", root_build_dir),
1247 if (host_os == "mac") {
1248 args += [ "--nm-path=$mac_bin_path/nm" ]
1250 args += [ "--nm-path=" +
1251 rebase_path("$clang_base_path/bin/llvm-nm", root_build_dir) ]
1253 outputs = [ stamp_file ]
1254 public_deps = [ ":chrome_framework" ]
1257 group("verify_chrome_framework_order") {
1258 if (is_component_build) {
1259 # In a component build, the framework is directly linked to the
1260 # executable because dlopen() and loading all the dependent dylibs
1261 # is time-consuming, see https://crbug.com/1197495.
1262 public_deps = [ ":chrome_framework+link" ]
1264 public_deps = [ ":chrome_framework" ]
1269 if (enable_dsyms && !is_component_build) {
1270 # It is possible to run dump_syms on unstripped products without dSYMs, but
1271 # doing so isn't logical and won't happen in practice. It's also pointless
1272 # to run dump_syms or archive dSYMs in a component build, where all of the
1273 # interesting symbols and debug info are tucked away in other libraries
1274 # beyond the set explicitly listed here.
1276 # This list must be updated with the two targets' deps list below, and
1277 # the list of _dsyms in :chrome_dsym_archive.
1278 _chrome_symbols_sources = [
1279 "$root_out_dir/$chrome_product_full_name.app/Contents/MacOS/$chrome_product_full_name",
1280 "$root_out_dir/chrome_crashpad_handler",
1281 "$root_out_dir/libEGL.dylib",
1282 "$root_out_dir/libGLESv2.dylib",
1283 "$root_out_dir/libvk_swiftshader.dylib",
1284 _framework_binary_path,
1286 if (build_with_internal_optimization_guide) {
1287 _chrome_symbols_sources +=
1288 [ "$root_out_dir/liboptimization_guide_internal.dylib" ]
1291 foreach(helper_params, chrome_mac_helpers) {
1292 _chrome_symbols_sources += [ "$root_out_dir/${chrome_helper_name}${helper_params[2]}.app/Contents/MacOS/${chrome_helper_name}${helper_params[2]}" ]
1295 action_foreach("chrome_dump_syms") {
1296 script = "//build/redirect_stdout.py"
1298 sources = _chrome_symbols_sources
1301 [ "$root_out_dir/{{source_file_part}}-$chrome_version_full.breakpad" ]
1303 dump_syms = "//third_party/breakpad:dump_syms($host_toolchain)"
1304 args = rebase_path(outputs, root_build_dir) + [
1305 rebase_path(get_label_info(dump_syms, "root_out_dir") + "/" +
1306 get_label_info(dump_syms, "name"),
1310 "$root_out_dir/{{source_file_part}}.dSYM/Contents/Resources/DWARF/{{source_file_part}}",
1317 ":chrome_framework",
1318 "//components/crash/core/app:chrome_crashpad_handler",
1319 "//third_party/angle:libEGL",
1320 "//third_party/angle:libGLESv2",
1321 "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan",
1324 if (build_with_internal_optimization_guide) {
1325 deps += [ "//components/optimization_guide/internal:optimization_guide_internal" ]
1328 foreach(helper_params, chrome_mac_helpers) {
1329 deps += [ ":chrome_helper_app_${helper_params[0]}" ]
1333 action("chrome_dsym_archive") {
1334 script = "//chrome/tools/build/mac/archive_symbols.py"
1336 # These are the dSYMs that will be archived. The sources list must be
1337 # the target outputs that correspond to the dSYMs (since a dSYM is a
1338 # directory it cannot be listed as a source file). The targets that
1339 # generate both the dSYM and binary image are listed in deps.
1341 "$root_out_dir/$chrome_framework_name.dSYM",
1342 "$root_out_dir/$chrome_product_full_name.dSYM",
1343 "$root_out_dir/chrome_crashpad_handler.dSYM",
1344 "$root_out_dir/libEGL.dylib.dSYM",
1345 "$root_out_dir/libGLESv2.dylib.dSYM",
1346 "$root_out_dir/libvk_swiftshader.dylib.dSYM",
1348 if (build_with_internal_optimization_guide) {
1349 _dsyms += [ "$root_out_dir/liboptimization_guide_internal.dylib.dSYM" ]
1354 ":chrome_framework",
1355 "//components/crash/core/app:chrome_crashpad_handler",
1356 "//third_party/angle:libEGL",
1357 "//third_party/angle:libGLESv2",
1358 "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan",
1360 if (build_with_internal_optimization_guide) {
1361 deps += [ "//components/optimization_guide/internal:optimization_guide_internal" ]
1364 foreach(helper_params, chrome_mac_helpers) {
1366 [ "$root_out_dir/${chrome_helper_name}${helper_params[2]}.dSYM" ]
1367 deps += [ ":chrome_helper_app_${helper_params[0]}" ]
1370 sources = _chrome_symbols_sources
1372 _output = "$root_out_dir/$chrome_product_full_name.dSYM.tar.bz2"
1374 outputs = [ _output ]
1376 args = [ rebase_path(_output, root_out_dir) ] +
1377 rebase_path(_dsyms, root_out_dir)
1380 group("chrome_dump_syms") {
1382 group("chrome_dsym_archive") {
1387 group("dependencies") {
1389 "//build:branding_buildflags",
1390 "//build:chromeos_buildflags",
1392 "//chrome/browser/policy:path_parser",
1396 "//chrome/renderer",
1398 "//components/about_ui",
1399 "//components/gwp_asan/buildflags",
1400 "//components/heap_profiling/in_process",
1401 "//components/power_scheduler",
1402 "//components/services/heap_profiling",
1403 "//components/startup_metric_utils/browser",
1404 "//components/sync",
1405 "//components/upload_list:upload_list",
1406 "//content/public/child",
1408 "//services/tracing/public/cpp",
1409 "//third_party/blink/public:blink_devtools_frontend_resources",
1410 "//third_party/blink/public:blink_devtools_inspector_resources",
1415 public_deps += [ "//ppapi/host" ]
1418 if (enable_basic_printing) {
1419 public_deps += [ "//printing" ]
1422 if (enable_gwp_asan) {
1423 public_deps += [ "//components/gwp_asan/client" ]
1428 "//components/nacl/browser",
1429 "//components/nacl/renderer/plugin:nacl_trusted_plugin",
1434 public_deps += [ "//chromeos/dbus/constants" ]
1437 if (is_chromeos_lacros) {
1439 "//chromeos/lacros",
1440 "//chromeos/lacros/dbus",
1444 if (is_chromeos_ash) {
1447 "//chrome/browser/ash",
1449 "//chromeos/ash/components/memory",
1454 public_deps += [ "//components/crash/core/app" ]
1459 process_version_rc_template("chrome_exe_version") {
1460 sources = [ "app/chrome_exe.ver" ]
1461 output = "$target_gen_dir/chrome_exe_version.rc"
1464 process_version_rc_template("chrome_dll_version") {
1465 sources = [ "app/chrome_dll.ver" ]
1466 output = "$target_gen_dir/chrome_dll_version.rc"
1469 # This manifest matches what GYP produced. It may not even be necessary.
1470 windows_manifest("chrome_dll_manifest") {
1472 as_invoker_manifest,
1473 common_controls_manifest,
1477 process_version_rc_template("nacl64_exe_version") {
1478 sources = [ "app/nacl64_exe.ver" ]
1479 output = "$target_gen_dir/nacl64_exe_version.rc"
1482 process_version_rc_template("other_version") {
1483 sources = [ "app/other.ver" ]
1484 output = "$target_gen_dir/other_version.rc"
1488 copy("visual_elements_resources") {
1490 "//chrome/app/theme/$branding_path_component/win/tiles/Logo.png",
1491 "//chrome/app/theme/$branding_path_component/win/tiles/SmallLogo.png",
1492 "app/visual_elements_resources/chrome.VisualElementsManifest.xml",
1495 if (is_chrome_branded) {
1497 "//chrome/app/theme/$branding_path_component/win/tiles/LogoBeta.png",
1498 "//chrome/app/theme/$branding_path_component/win/tiles/LogoCanary.png",
1499 "//chrome/app/theme/$branding_path_component/win/tiles/LogoDev.png",
1500 "//chrome/app/theme/$branding_path_component/win/tiles/SmallLogoBeta.png",
1501 "//chrome/app/theme/$branding_path_component/win/tiles/SmallLogoCanary.png",
1502 "//chrome/app/theme/$branding_path_component/win/tiles/SmallLogoDev.png",
1506 outputs = [ "$root_out_dir/{{source_file_part}}" ]
1509 group("resources") {
1511 "//chrome/browser:resources",
1512 "//chrome/common:resources",
1513 "//chrome/renderer:resources",
1517 group("extra_resources") {
1518 # Deps should be same as those in chrome_extra_paks() within chrome_paks.gni.
1520 "//chrome/browser/resources:resources",
1521 "//components/autofill/core/browser:autofill_address_rewriter_resources",
1525 if (is_chrome_branded && !is_android) {
1527 _preinstalled_apps_target_type = "copy"
1529 _preinstalled_apps_target_type = "bundle_data"
1532 target(_preinstalled_apps_target_type, "preinstalled_apps") {
1533 visibility = [ ":packed_resources" ]
1536 ":chrome_framework",
1537 ":chrome_framework_shared_library",
1541 sources = [ "browser/resources/default_apps/external_extensions.json" ]
1544 outputs = [ "$root_out_dir/default_apps/{{source_file_part}}" ]
1546 outputs = [ "{{bundle_contents_dir}}/Default Apps/{{source_file_part}}" ]
1549 # Force anybody that depends on this to get the default apps as data files.
1550 data = process_file_template(sources, outputs)
1555 chrome_paks("packed_resources") {
1557 output_dir = "$root_gen_dir/repack"
1558 copy_data_to_bundle = true
1560 output_dir = root_out_dir
1564 if (enable_resource_allowlist_generation) {
1565 repack_allowlist = _chrome_resource_allowlist
1566 deps = [ ":resource_allowlist" ]
1569 if (is_chrome_branded && !is_mac) {
1570 public_deps = [ ":preinstalled_apps" ]
1575 "chrome_100_percent.pak",
1578 files_to_hash += [ "chrome_200_percent.pak" ]
1583 repack("unit_tests_pak") {
1585 sources = [ "$root_gen_dir/chrome/chrome_test_resources.pak" ]
1586 output = "$root_out_dir/unit_tests.pak"
1587 deps = [ "//chrome/test/data:chrome_test_resources" ]
1590 repack("browser_tests_pak") {
1592 sources = [ "$root_gen_dir/chrome/webui_test_resources.pak" ]
1593 output = "$root_out_dir/browser_tests.pak"
1594 deps = [ "//chrome/test/data:webui_test_resources" ]
1596 sources += [ "$root_gen_dir/chrome/webui_generated_test_resources.pak" ]
1597 deps += [ "//chrome/test/data/webui:resources" ]
1603 "//chrome/app:chromium_strings",
1604 "//chrome/app:generated_resources",
1605 "//chrome/app:google_chrome_strings",
1606 "//chrome/app/resources:locale_settings",
1611 java_cpp_enum("partner_bookmarks_javagen") {
1612 sources = [ "browser/android/bookmarks/partner_bookmarks_reader.h" ]
1615 java_cpp_enum("offline_pages_enum_javagen") {
1616 sources = [ "browser/offline_pages/offline_page_utils.h" ]
1619 java_cpp_enum("download_enum_javagen") {
1621 "browser/download/android/download_open_source.h",
1622 "browser/download/download_dialog_types.h",
1623 "browser/download/download_prompt_status.h",
1627 java_cpp_enum("instant_apps_reasons_enum_javagen") {
1628 sources = [ "browser/android/instantapps/instant_apps_settings.cc" ]
1631 java_cpp_enum("supervised_user_url_filter_enum_javagen") {
1632 sources = [ "browser/supervised_user/supervised_user_url_filter.h" ]
1635 java_cpp_enum("context_menu_image_format_enum_javagen") {
1637 [ "browser/android/context_menu/context_menu_native_delegate_impl.h" ]
1640 source_set("chrome_android_core") {
1642 "app/android/chrome_jni_onload.cc",
1643 "app/android/chrome_jni_onload.h",
1644 "app/android/chrome_main_delegate_android.cc",
1645 "app/android/chrome_main_delegate_android.h",
1646 "app/chrome_main_delegate.cc",
1647 "app/chrome_main_delegate.h",
1662 "//chrome/browser/ui",
1665 "//chrome/common/profiler",
1667 "//chrome/renderer",
1668 "//components/gwp_asan/buildflags",
1669 "//components/heap_profiling/in_process",
1670 "//components/minidump_uploader",
1671 "//components/safe_browsing:buildflags",
1672 "//components/safe_browsing/android:safe_browsing_api_handler",
1673 "//components/safe_browsing/android:safe_browsing_mobile",
1674 "//components/services/heap_profiling",
1675 "//content/public/app",
1678 # Explicit dependency required for JNI registration to be able to
1679 # find the native side functions.
1680 if (is_android && is_component_build) {
1682 "//components/viz/service",
1684 "//ui/events/devices",
1690 "//chrome/browser/flags:flags_android",
1691 "//components/crash/android:crash_android",
1695 if (is_chromeos_ash) {
1696 public_deps += [ "//ui/lottie" ]
1700 deps += [ "//third_party/gvr-android-sdk:gvr_shim" ]
1703 if (enable_gwp_asan) {
1704 deps += [ "//components/gwp_asan/client" ]
1709 # Android also supports this, but uses
1710 # //chrome/android:${_variant}_resource_allowlist.
1711 if (is_win && enable_resource_allowlist_generation) {
1712 generate_resource_allowlist("resource_allowlist") {
1713 deps = [ ":chrome_dll" ]
1714 inputs = [ "$root_out_dir/chrome.dll.pdb" ]
1715 output = _chrome_resource_allowlist
1719 if (is_linux || is_chromeos || is_tizen) {
1720 if (is_official_build) {
1721 group("linux_symbols") {
1723 ":angle_egl_symbols",
1724 ":angle_gles_symbols",
1725 ":chrome_crashpad_symbols",
1729 deps += [ ":swiftshader_vk_symbols" ]
1731 if (!is_chromeos && !is_tizen) {
1732 deps += [ ":angle_libvulkan_symbols" ]
1734 if (build_with_internal_optimization_guide) {
1735 deps += [ ":optimization_guide_symbols" ]
1738 extract_symbols("chrome_symbols") {
1739 binary = "$root_out_dir/chrome"
1741 if (current_cpu == "x86") {
1742 # GYP used "ia32" so keep that naming for back-compat.
1743 symbol_file = "$root_out_dir/chrome.breakpad.ia32"
1745 symbol_file = "$root_out_dir/chrome.breakpad.$current_cpu"
1748 deps = [ ":chrome" ]
1750 extract_symbols("chrome_crashpad_symbols") {
1751 binary = "$root_out_dir/chrome_crashpad_handler"
1753 if (current_cpu == "x86") {
1754 # GYP used "ia32" so keep that naming for back-compat.
1755 symbol_file = "$root_out_dir/crashpad.breakpad.ia32"
1757 symbol_file = "$root_out_dir/crashpad.breakpad.$current_cpu"
1760 deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
1762 extract_symbols("swiftshader_vk_symbols") {
1763 binary = "$root_out_dir/libvk_swiftshader.so"
1765 if (current_cpu == "x86") {
1766 # GYP used "ia32" so keep that naming for back-compat.
1767 symbol_file = "$root_out_dir/libvk_swiftshader.breakpad.ia32"
1769 symbol_file = "$root_out_dir/libvk_swiftshader.breakpad.$current_cpu"
1772 deps = [ "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan" ]
1774 extract_symbols("angle_egl_symbols") {
1775 binary = "$root_out_dir/libEGL.so"
1777 if (current_cpu == "x86") {
1778 # GYP used "ia32" so keep that naming for back-compat.
1779 symbol_file = "$root_out_dir/angle_libegl.breakpad.ia32"
1781 symbol_file = "$root_out_dir/angle_libegl.breakpad.$current_cpu"
1784 deps = [ "//third_party/angle:libEGL" ]
1786 extract_symbols("angle_gles_symbols") {
1787 binary = "$root_out_dir/libGLESv2.so"
1789 if (current_cpu == "x86") {
1790 # GYP used "ia32" so keep that naming for back-compat.
1791 symbol_file = "$root_out_dir/angle_libgles.breakpad.ia32"
1793 symbol_file = "$root_out_dir/angle_libgles.breakpad.$current_cpu"
1796 deps = [ "//third_party/angle:libGLESv2" ]
1798 if (!is_chromeos && !is_tizen) {
1799 extract_symbols("angle_libvulkan_symbols") {
1800 binary = "$root_out_dir/libvulkan.so.1"
1802 if (current_cpu == "x86") {
1803 # GYP used "ia32" so keep that naming for back-compat.
1804 symbol_file = "$root_out_dir/angle_libvulkan.breakpad.ia32"
1806 symbol_file = "$root_out_dir/angle_libvulkan.breakpad.$current_cpu"
1809 deps = [ "//third_party/vulkan-deps/vulkan-loader/src:libvulkan" ]
1812 if (build_with_internal_optimization_guide) {
1813 extract_symbols("optimization_guide_symbols") {
1814 binary = "$root_out_dir/liboptimization_guide_internal.so"
1815 if (current_cpu == "x86") {
1816 # GYP used "ia32" so keep that naming for back-compat.
1818 "$root_out_dir/optimization_guide_internal.breakpad.ia32"
1821 "$root_out_dir/optimization_guide_internal.breakpad.$current_cpu"
1824 deps = [ "//components/optimization_guide/internal:optimization_guide_internal" ]
1829 # Copies some scripts and resources that are used for desktop integration.
1832 "//chrome/tools/build/linux/chrome-wrapper",
1833 "//third_party/xdg-utils/scripts/xdg-mime",
1834 "//third_party/xdg-utils/scripts/xdg-settings",
1838 [ "//chrome/app/theme/$branding_path_component/product_logo_48.png" ]
1841 "//chrome/app/theme/$branding_path_component/linux/product_logo_48.png",
1844 outputs = [ "$root_out_dir/{{source_file_part}}" ]
1848 if (is_chromeos_lacros && is_official_build) {
1849 # This will strip chrome binary and produce chrome.debug with symbols.
1850 strip_binary("strip_chrome_binary") {
1851 binary_input = "$root_out_dir/chrome"
1852 symbol_output = "$root_out_dir/chrome.debug"
1853 stripped_binary_output = "$root_out_dir/chrome.stripped"
1854 deps = [ ":chrome" ]