blob: 3ebcf1329c2cc7b8354ebe439b6d4c1376b9f75b [file] [log] [blame]
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chrome_build.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/features.gni")
import("//build/config/locales.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
import("//build/config/win/console_app.gni")
import("//build/config/win/manifest.gni")
import("//chrome/chrome_repack_locales.gni")
import("//chrome/version.gni")
declare_args() {
# Specify the current PGO phase, only used for the Windows MSVS build. Here's
# the different values that can be used:
# 0 : Means that PGO is turned off.
# 1 : Used during the PGI (instrumentation) phase.
# 2 : Used during the PGO (optimization) phase.
#
# TODO(sebmarchand): Add support for the PGU (update) phase.
chrome_pgo_phase = 0
}
if (is_android) {
import("//build/config/android/rules.gni")
}
if (is_win) {
action("reorder_imports") {
script = "//build/win/reorder-imports.py"
# See comment in chrome_dll.gypi in the hardlink_to_output
# target for why this cannot be 'initial' like the DLL.
inputs = [
"$root_out_dir/initialexe/chrome.exe",
]
outputs = [
"$root_out_dir/chrome.exe",
"$root_out_dir/chrome.exe.pdb",
]
args = [
"-i",
rebase_path("$root_out_dir/initialexe", root_build_dir),
"-o",
rebase_path("$root_out_dir", root_build_dir),
"-a",
target_cpu,
]
deps = [
":chrome_initial",
]
}
}
if (!is_android) {
group("chrome") {
public_deps = [
":chrome_initial",
]
if (is_win) {
public_deps += [ ":reorder_imports" ]
}
}
executable("chrome_initial") {
if (is_win) {
output_name = "initialexe/chrome"
} else {
output_name = "chrome"
}
# Because the sources list varies so significantly per-platform, generally
# each platform lists its own files rather than relying on filtering or
# removing unused files.
sources = [
"app/chrome_exe_resource.h",
]
defines = []
public_deps = []
deps = [
"//build/config/sanitizers:deps",
]
data = [
"$root_out_dir/resources.pak",
]
if (is_linux || is_win) {
data += [
"$root_out_dir/chrome_100_percent.pak",
"$root_out_dir/locales/en-US.pak",
"$root_out_dir/locales/fr.pak",
]
}
data_deps = []
# TODO(GYP) mac_bundle_resources, xcode_settings
if (is_win) {
sources += [
"app/chrome_crash_reporter_client.cc",
"app/chrome_crash_reporter_client.h",
"app/chrome_exe.rc",
"app/chrome_exe_load_config_win.cc",
"app/chrome_exe_main_win.cc",
"app/chrome_watcher_client_win.cc",
"app/chrome_watcher_client_win.h",
"app/chrome_watcher_command_line_win.cc",
"app/chrome_watcher_command_line_win.h",
"app/kasko_client.cc",
"app/kasko_client.h",
"app/main_dll_loader_win.cc",
"app/main_dll_loader_win.h",
"common/crash_keys.cc",
"common/crash_keys.h",
]
deps += [
":chrome_dll",
":chrome_exe_version",
":file_pre_reader",
# 'chrome_nacl_win64" TODO(GYP) bug 512869
"//base",
"//breakpad:breakpad_handler",
"//breakpad:breakpad_sender",
"//chrome/app/version_assembly:chrome_exe_manifest",
"//chrome/browser:chrome_process_finder",
"//chrome/chrome_watcher",
"//chrome/chrome_watcher:client",
"//chrome/installer/util:with_no_strings",
"//chrome_elf",
"//components/browser_watcher:browser_watcher_client",
"//components/crash/content/app",
"//components/crash/core/common",
"//components/flags_ui:switches",
"//components/startup_metric_utils/common",
"//content:sandbox_helper_win",
"//content/public/common:static_switches",
"//crypto",
"//sandbox",
"//ui/gfx",
"//win8/delegate_execute",
]
data_deps = [
"//chrome/app/version_assembly:version_assembly_manifest",
]
if (win_console_app) {
defines += [ "WIN_CONSOLE_APP" ]
} else {
# Set /SUBSYSTEM:WINDOWS for chrome.exe itself, unless a console build
# has been requested.
configs -= [ "//build/config/win:console" ]
configs += [ "//build/config/win:windowed" ]
}
} else if (use_aura) {
# Non-Windows aura entrypoint.
sources += [ "app/chrome_exe_main_aura.cc" ]
}
if (is_linux) {
sources += [
"app/chrome_dll_resource.h",
"app/chrome_main.cc",
"app/chrome_main_delegate.cc",
"app/chrome_main_delegate.h",
]
deps += [
# On Linux, link the dependencies (libraries) that make up actual
# Chromium functionality directly into the executable.
":browser_dependencies",
":child_dependencies",
":manpage",
# Needed to use the master_preferences functions
"//chrome/installer/util:with_no_strings",
"//content/public/app:both",
]
if (enable_plugins && enable_pdf) {
deps += [ "//pdf" ]
}
public_deps = [
":xdg_mime", # Needs to be public for installer to consume files.
]
# GYP has this in a 'profiling==0 and linux_disable_pie==0' condition.
# but GN doesn't have either of these flags.
ldflags = [ "-pie" ]
if (use_pango || use_cairo) {
# Needed for chrome_main.cc initialization of libraries.
configs += [ "//build/config/linux:pangocairo" ]
}
if (use_x11) {
configs += [
"//build/config/linux:x11",
"//build/config/linux:xext",
]
}
}
if (is_mac) {
sources += [ "app/chrome_exe_main_mac.c" ]
deps += [ ":chrome_dll" ]
# TODO(GYP) lots more stuff in the is_mac block.
} else { # Non-Mac.
# These files are used by the installer so we need a public dep.
public_deps += [
":packed_extra_resources",
":packed_resources",
]
deps += [
"//components/startup_metric_utils/browser:lib",
# Precompiled plugins that need to get copied to the output directory.
# On Mac, internal plugins go inside the framework, so these
# dependencies are on chrome.dll.
"//third_party/adobe/flash:flapper_binaries",
"//third_party/widevine/cdm:widevinecdmadapter",
]
}
if (is_multi_dll_chrome) {
defines += [ "CHROME_MULTIPLE_DLL" ]
data_deps += [ ":chrome_child" ]
}
}
} # !is_android
if (is_mac) {
if (is_component_build) {
# On Mac component builds, this target is the bundle, and the main dll is
# just another shared library. This speeds up incremental builds by
# not requiring re-doing the bundle every time main_dll changes.
# See https://codereview.chromium.org/11420019
# TODO(GYP) chrome_dll for Mac component build.
assert(false)
} else {
# On Mac non-component builds, this is a no-op forwarding target.
group("chrome_dll") {
public_deps = [
":main_dll",
]
}
}
}
if (is_win) {
# This target is a forwarding target to compile the necessary DLLs used
# by Chrome.
group("chrome_dll") {
# TODO(GYP) support incremental_chrome_dll on Windows for faster links in
# developer component builds. When that's supported, this target will need
# to become more complicated.
data_deps = [
":main_dll",
]
if (is_multi_dll_chrome) {
data_deps += [ ":chrome_child" ]
}
}
}
if (is_mac || is_win) {
shared_library("main_dll") {
configs += [ "//build/config/compiler:wexit_time_destructors" ]
defines = []
ldflags = []
sources = [
"//base/win/dllmain.cc",
"app/chrome_command_ids.h",
"app/chrome_dll.rc",
"app/chrome_dll_resource.h",
"app/chrome_main.cc",
"app/chrome_main_delegate.cc",
"app/chrome_main_delegate.h",
"app/chrome_main_mac.h",
"app/chrome_main_mac.mm",
"app/delay_load_hook_win.cc",
"app/delay_load_hook_win.h",
]
deps = [
":browser_dependencies",
"//build/config/sanitizers:deps",
]
if (is_win) {
output_name = "chrome"
deps += [
":chrome_dll_manifest",
":chrome_dll_version",
"//base/trace_event/etw_manifest:chrome_events_win",
"//chrome/app/theme:chrome_unscaled_resources",
"//chrome_elf",
"//components/crash/content/app",
"//content/app/resources",
"//crypto",
"//net:net_resources",
"//third_party/wtl",
"//ui/views",
]
if (enable_configuration_policy) {
deps += [ "//components/policy" ]
}
if (current_cpu == "x86") {
# TODO(GYP) bug 512861: Lots of VCLinkerTool stuff on Windows.
#deps += [ 'chrome_user32_delay_imports' ] TODO(GYP)
}
if (!is_component_build) {
# This is a large module that can't do incremental linking in some cases.
configs -= [ "//build/config/win:default_incremental_linking" ]
configs +=
[ "//build/config/win:default_large_module_incremental_linking" ]
}
}
if (use_aura) {
deps += [ "//ui/compositor" ]
}
if (is_multi_dll_chrome) {
defines += [ "CHROME_MULTIPLE_DLL_BROWSER" ]
deps += [ "//content/public/app:browser" ]
} else {
deps += [
":child_dependencies",
"//content/public/app:both",
]
}
if (cld_version == 2) {
deps += [ "//third_party/cld_2" ]
}
if (is_mac) {
#['OS=="mac" and component!="shared_library"', { TODO(GYP)
# 'includes': [ 'chrome_dll_bundle.gypi' ],
#}],
# TODO(GYP) Lots of other stuff in the OS=="mac" block.
sources += [
"app/chrome_crash_reporter_client.cc",
"app/chrome_crash_reporter_client.h",
"app/chrome_crash_reporter_client_mac.mm",
]
deps += [
"//components/crash/content/app",
"//components/policy",
]
# Define the order of symbols within the framework.
ldflags += [
"-Wl,-order_file",
"-Wl," + rebase_path("app/framework.order", root_build_dir),
]
}
if (enable_plugins && enable_pdf && !is_multi_dll_chrome) {
deps += [ "//pdf" ]
}
}
if (is_multi_dll_chrome) {
# This manifest matches what GYP produces. It may not even be necessary.
windows_manifest("chrome_child_manifest") {
sources = [
as_invoker_manifest,
]
type = "dll"
}
shared_library("chrome_child") {
sources = [
"app/chrome_main.cc",
"app/chrome_main_delegate.cc",
"app/chrome_main_delegate.h",
]
configs += [ "//build/config/compiler:wexit_time_destructors" ]
defines = [ "CHROME_MULTIPLE_DLL_CHILD" ]
deps = [
":child_dependencies",
":chrome_child_manifest",
":chrome_dll_version",
"//build/config/sanitizers:deps",
"//components/browser_watcher:browser_watcher_client",
"//components/crash/content/app",
"//content/public/app:child",
]
if (is_win) {
if (symbol_level == 2) {
# Incremental linking doesn't work on this target in debug mode with
# full symbols, but does work in other cases, including minimal
# symbols.
configs -= [ "//build/config/win:default_incremental_linking" ]
configs += [ "//build/config/win:no_incremental_linking" ]
}
if (chrome_pgo_phase > 0) {
cflags += [
"/GL", # Whole program optimization.
# Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds.
# Probably anything that this would catch that wouldn't be caught in
# a normal build isn't going to actually be a bug, so the
# incremental value of C4702 for PGO builds is likely very small.
"/wd4702",
]
}
if (chrome_pgo_phase == 1) {
ldflags = [
"/LTCG:PGINSTRUMENT",
"/PogoSafeMode",
]
} else if (chrome_pgo_phase == 2) {
ldflags = [ "/LTCG:PGOPTIMIZE" ]
}
}
if (enable_configuration_policy) {
deps += [ "//chrome/browser/policy:path_parser" ]
}
if (enable_plugins && enable_pdf) {
deps += [ "//pdf" ]
}
}
}
}
# GYP version: chromium_browser_dependencies variable in chrome.gyp
group("browser_dependencies") {
public_deps = [
"//chrome/browser",
"//chrome/common",
"//sync",
]
if (enable_plugins) {
public_deps += [ "//ppapi/host" ]
}
if (enable_basic_printing || enable_print_preview) {
public_deps += [ "//printing" ]
if (enable_print_preview) {
public_deps += [ "//chrome/service" ]
}
}
if (!is_component_build) {
assert_no_deps = [
# Blink and V8 should not be used in the browser process. In component
# build this is OK because all of content is linked into one library.
# Note that the blink_headers target is OK, so we can't do a wildcard for
# all blink targets.
# TODO(brettw) bug 582206: Blink should not be linked into the browser
# process, and then we can enable this.
#"//third_party/WebKit/public:blink",
# TODO(brettw) bug 581766: V8 should not be linked into the browser
# process, and then we can enable this.
#"//v8/*",
]
}
}
# GYP version: chromium_child_dependencies variable in chrome.gyp
group("child_dependencies") {
public_deps = [
"//chrome/common",
"//sync",
]
if (!is_ios) {
public_deps += [
"//chrome/browser/devtools",
"//chrome/child",
"//chrome/plugin",
"//chrome/renderer",
"//chrome/utility",
"//content/public/child",
"//third_party/WebKit/public:blink_devtools_frontend_resources",
]
}
if (cld_version == 2) {
public_deps += [ "//third_party/cld_2:cld2_platform_impl" ]
}
if (enable_nacl) {
public_deps += [ "//components/nacl/renderer/plugin:nacl_trusted_plugin" ]
}
}
if (is_win) {
process_version("chrome_exe_version") {
template_file = chrome_version_rc_template
sources = [
"app/chrome_exe.ver",
]
output = "$target_gen_dir/chrome_exe_version.rc"
}
process_version("chrome_dll_version") {
template_file = chrome_version_rc_template
sources = [
"app/chrome_dll.ver",
]
output = "$target_gen_dir/chrome_dll_version.rc"
}
# This manifest matches what GYP produces. It may not even be necessary.
windows_manifest("chrome_dll_manifest") {
sources = [
as_invoker_manifest,
common_controls_manifest,
]
type = "dll"
}
process_version("nacl64_exe_version") {
template_file = chrome_version_rc_template
sources = [
"app/nacl64_exe.ver",
]
output = "$target_gen_dir/nacl64_exe_version.rc"
}
process_version("other_version") {
template_file = chrome_version_rc_template
sources = [
"app/other.ver",
]
output = "$target_gen_dir/other_version.rc"
}
source_set("file_pre_reader") {
sources = [
"app/file_pre_reader_win.cc",
"app/file_pre_reader_win.h",
]
deps = [
"//base",
"//components/startup_metric_utils/common",
]
}
}
# GYP version: chrome/chrome_resources.gyp:chrome_resources
group("resources") {
public_deps = [
# Note: GYP lists some dependencies in addition to these actions. However,
# these are just dependencies for the actions themselves, which our actions
# list individually when needed.
"//chrome/browser:resources",
"//chrome/common:resources",
"//chrome/renderer:resources",
]
if (enable_extensions) {
public_deps += [ "//chrome/common:extensions_api_resources" ]
}
}
# GYP version: chrome/chrome_resources.gyp:chrome_extra_resources
group("extra_resources") {
public_deps = [
"//chrome/browser/resources:invalidations_resources",
"//chrome/browser/resources:memory_internals_resources",
"//chrome/browser/resources:net_internals_resources",
"//chrome/browser/resources:password_manager_internals_resources",
"//chrome/browser/resources:policy_resources",
"//chrome/browser/resources:translate_internals_resources",
]
if (!is_ios) {
public_deps += [
"//chrome/browser/resources:component_extension_resources",
"//chrome/browser/resources:options_resources",
"//chrome/browser/resources:settings_resources",
]
}
if (is_chromeos) {
public_deps += [ "//chrome/browser/resources/chromeos/chromevox" ]
}
if (enable_extensions) {
public_deps += [
"//chrome/browser/resources:quota_internals_resources",
"//chrome/browser/resources:sync_file_system_internals_resources",
]
}
}
if (is_chrome_branded) {
copy("default_apps") {
visibility = [ ":packed_resources" ]
sources = [
"browser/resources/default_apps/docs.crx",
"browser/resources/default_apps/drive.crx",
"browser/resources/default_apps/external_extensions.json",
"browser/resources/default_apps/gmail.crx",
"browser/resources/default_apps/youtube.crx",
]
outputs = [
"$root_out_dir/default_apps/{{source_file_part}}",
]
# Force anybody that depends on this to get the default apps as data files.
data = process_file_template(sources, outputs)
}
}
group("packed_resources") {
public_deps = [
":repack_chrome_100_percent",
":repack_locales_pack",
":repack_pseudo_locales_pack",
]
if (is_chrome_branded) {
public_deps += [ ":default_apps" ]
}
if (enable_hidpi) {
public_deps += [ ":repack_chrome_200_percent" ]
}
if (enable_topchrome_md) {
public_deps += [ ":repack_chrome_material_100_percent" ]
if (enable_hidpi) {
public_deps += [ ":repack_chrome_material_200_percent" ]
}
}
}
repack("packed_extra_resources") {
visibility = [ "./*" ]
sources = [
"$root_gen_dir/chrome/browser_resources.pak",
"$root_gen_dir/chrome/chrome_unscaled_resources.pak",
"$root_gen_dir/chrome/common_resources.pak",
"$root_gen_dir/chrome/invalidations_resources.pak",
"$root_gen_dir/chrome/memory_internals_resources.pak",
"$root_gen_dir/chrome/net_internals_resources.pak",
"$root_gen_dir/chrome/password_manager_internals_resources.pak",
"$root_gen_dir/chrome/policy_resources.pak",
"$root_gen_dir/chrome/translate_internals_resources.pak",
"$root_gen_dir/components/components_resources.pak",
"$root_gen_dir/net/net_resources.pak",
"$root_gen_dir/ui/resources/webui_resources.pak",
]
deps = [
"//chrome/app/theme:chrome_unscaled_resources",
"//chrome/browser:resources",
"//chrome/browser/resources:invalidations_resources",
"//chrome/browser/resources:memory_internals_resources",
"//chrome/browser/resources:net_internals_resources",
"//chrome/browser/resources:password_manager_internals_resources",
"//chrome/browser/resources:policy_resources",
"//chrome/browser/resources:translate_internals_resources",
"//chrome/common:resources",
"//components/resources",
"//net:net_resources",
"//ui/resources",
]
if (!is_ios && !is_android) {
# New paks should be added here by default.
sources += [
"$root_gen_dir/blink/devtools_resources.pak",
"$root_gen_dir/chrome/component_extension_resources.pak",
"$root_gen_dir/chrome/options_resources.pak",
"$root_gen_dir/chrome/quota_internals_resources.pak",
"$root_gen_dir/chrome/settings_resources.pak",
"$root_gen_dir/chrome/sync_file_system_internals_resources.pak",
]
deps += [
"//chrome/browser/resources:component_extension_resources",
"//chrome/browser/resources:options_resources",
"//chrome/browser/resources:quota_internals_resources",
"//chrome/browser/resources:settings_resources",
"//chrome/browser/resources:sync_file_system_internals_resources",
"//content/browser/devtools:devtools_resources",
]
}
if (!is_ios) {
sources += [
"$root_gen_dir/blink/public/resources/blink_resources.pak",
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
"$root_gen_dir/content/content_resources.pak",
]
deps += [
"//content:resources",
"//content/browser/tracing:resources",
"//third_party/WebKit/public:resources",
]
}
if (is_chromeos) {
sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ]
deps += [ "//ui/file_manager:resources" ]
}
if (enable_extensions) {
sources += [
"$root_gen_dir/chrome/extensions_api_resources.pak",
"$root_gen_dir/extensions/extensions_renderer_resources.pak",
"$root_gen_dir/extensions/extensions_resources.pak",
]
deps += [
"//chrome/common:extensions_api_resources",
"//extensions:extensions_resources",
]
}
# GYP outputs the file in the gen/repack directory. On non-Mac/iOS platforms
# it them copies it. This skipes the copy step and writes it to the final
# location.
if (is_mac || is_ios) {
output = "$root_gen_dir/repack/resources.pak"
} else {
output = "$root_out_dir/resources.pak"
}
}
# GYP version: chrome/chrome_resources.gyp:browser_tests_pak
repack("browser_tests_pak") {
sources = [
"$root_gen_dir/chrome/options_test_resources.pak",
"$root_gen_dir/chrome/webui_test_resources.pak",
]
output = "$root_out_dir/browser_tests.pak"
deps = [
"//chrome/browser/resources:options_test_resources",
"//chrome/test/data:webui_test_resources",
]
}
# Collects per-locale grit files from many sources into global per-locale files.
chrome_repack_locales("repack_locales_pack") {
visibility = [ ":*" ]
input_locales = locales
if (is_mac) {
output_locales = locales_as_mac_outputs
} else {
output_locales = locales
}
}
chrome_repack_locales("repack_pseudo_locales_pack") {
visibility = [ ":*" ]
input_locales = [ "fake-bidi" ]
if (is_mac) {
output_locales = [ "fake_bidi" ] # Mac uses underscores.
} else {
output_locales = [ "fake-bidi" ]
}
}
# Generates a rule to repack a set of resources, substituting a given string
# in for the percentage (e.g. "100", "200"). It generates the repacked files in
# the "gen" directory, and then introduces a copy rule to copy it to the root
# build directory.
#
# It's not clear why this two-step dance is necessary as opposed to just
# generating the file in the destination. However, this is what the GYP build
# does, and for maintenance purposes, this keeps the same files in the same
# place between the two builds when possible.
#
# Argument:
# percent [required]
# String to substitute for the percentage.
template("chrome_repack_percent") {
percent = invoker.percent
repack_name = "${target_name}_repack"
repack_output_file = "$root_gen_dir/repack/chrome_${percent}_percent.pak"
copy_name = target_name
repack(repack_name) {
visibility = [ ":$copy_name" ]
# All sources should also have deps for completeness.
sources = [
"$root_gen_dir/chrome/renderer_resources_${percent}_percent.pak",
"$root_gen_dir/chrome/theme_resources_${percent}_percent.pak",
"$root_gen_dir/components/components_resources_${percent}_percent.pak",
"$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak",
]
deps = [
"//chrome/app/theme:theme_resources",
"//chrome/renderer:resources",
"//components/resources",
"//components/strings",
"//net:net_resources",
"//ui/resources",
]
if (!is_ios) {
sources += [
"$root_gen_dir/blink/public/resources/blink_image_resources_${percent}_percent.pak",
"$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak",
]
deps += [
"//content/app/resources",
"//third_party/WebKit/public:image_resources",
]
}
if (use_ash) {
sources +=
[ "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak" ]
deps += [ "//ash/resources" ]
}
if (toolkit_views) {
sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak" ]
deps += [ "//ui/views/resources" ]
}
if (is_chromeos) {
sources += [ "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak" ]
deps += [ "//ui/chromeos/resources" ]
}
if (enable_extensions) {
sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ]
deps += [ "//extensions:extensions_browser_resources" ]
}
if (enable_app_list) {
sources += [ "$root_gen_dir/ui/app_list/resources/app_list_resources_${percent}_percent.pak" ]
deps += [ "//ui/app_list/resources" ]
}
output = repack_output_file
}
copy(copy_name) {
visibility = [ ":*" ]
deps = [
":$repack_name",
]
sources = [
repack_output_file,
]
outputs = [
"$root_build_dir/chrome_${percent}_percent.pak",
]
}
}
chrome_repack_percent("repack_chrome_100_percent") {
percent = "100"
}
if (enable_hidpi) {
chrome_repack_percent("repack_chrome_200_percent") {
percent = "200"
}
}
# Generates a rule to repack a set of material design resources for the browser
# top chrome, substituting a given string in for the percentage (e.g. "100",
# "200").
template("chrome_repack_material_percent") {
percent = invoker.percent
repack_name = "${target_name}_repack"
repack_output_file =
"$root_gen_dir/repack/chrome_material_${percent}_percent.pak"
copy_name = target_name
repack(repack_name) {
visibility = [ ":$copy_name" ]
# All sources should also have deps for completeness.
sources = [
"$root_gen_dir/chrome/theme_resources_material_${percent}_percent.pak",
"$root_gen_dir/components/components_resources_material_${percent}_percent.pak",
]
deps = [
"//chrome/app/theme:theme_resources",
"//components/resources",
]
output = repack_output_file
}
copy(copy_name) {
visibility = [ ":*" ]
deps = [
":$repack_name",
]
sources = [
repack_output_file,
]
outputs = [
"$root_build_dir/chrome_material_${percent}_percent.pak",
]
}
}
if (enable_topchrome_md) {
chrome_repack_material_percent("repack_chrome_material_100_percent") {
percent = "100"
}
if (enable_hidpi) {
chrome_repack_material_percent("repack_chrome_material_200_percent") {
percent = "200"
}
}
}
# GYP version: chrome/chrome_resources.gyp:chrome_strings
group("strings") {
public_deps = [
"//chrome/app:chromium_strings",
"//chrome/app:generated_resources",
"//chrome/app:google_chrome_strings",
"//chrome/app:settings_chromium_strings",
"//chrome/app:settings_google_chrome_strings",
"//chrome/app:settings_strings",
"//chrome/app/resources:locale_settings",
]
}
if (is_android) {
# GYP: //chrome/chrome.gyp:data_use_ui_message_enum_java
java_cpp_enum("data_use_ui_message_enum_javagen") {
sources = [
"browser/android/data_usage/data_use_tab_ui_manager_android.cc",
]
}
# GYP: //chrome/chrome.gyp:content_setting_java
java_cpp_enum("content_setting_javagen") {
sources = [
"../components/content_settings/core/common/content_settings.h",
]
}
# GYP: //chrome/chrome.gyp:content_settings_type_java
java_cpp_enum("content_settings_type_javagen") {
sources = [
"../components/content_settings/core/common/content_settings_types.h",
]
}
# GYP: //chrome/chrome.gyp:signin_metrics_enum_java
java_cpp_enum("signin_metrics_enum_javagen") {
sources = [
"../components/signin/core/browser/signin_metrics.h",
]
}
# GYP: //chrome/chrome.gyp:page_info_connection_type_java
java_cpp_enum("page_info_connection_type_javagen") {
sources = [
"browser/ui/android/website_settings_popup_android.h",
]
}
# Some android targets still depend on --gc-sections to link.
# TODO: remove --gc-sections for Debug builds (crbug.com/159847).
config("gc_sections") {
ldflags = [ "-Wl,--gc-sections" ]
}
# GYP: //chrome/chrome_android.gypi:chrome_android_core
source_set("chrome_android_core") {
sources = [
"app/android/chrome_android_initializer.cc",
"app/android/chrome_android_initializer.h",
"app/android/chrome_jni_onload.cc",
"app/android/chrome_jni_onload.h",
"app/android/chrome_main_delegate_android.cc",
"app/android/chrome_main_delegate_android.h",
"app/chrome_main_delegate.cc",
"app/chrome_main_delegate.h",
]
public_configs = [ ":gc_sections" ]
include_dirs = [ android_ndk_include_dir ]
libs = [
"android",
"jnigraphics",
]
deps = [
"//chrome/browser",
"//chrome/browser/ui",
"//chrome/child",
"//chrome/common",
"//chrome/plugin",
"//chrome/renderer",
"//chrome/utility",
"//components/safe_browsing_db:safe_browsing_db_mobile",
"//content/public/app:both",
]
}
}
if (is_linux) {
action("manpage") {
if (is_chrome_branded) {
name = "Google Chrome"
filename = "google-chrome"
confdir = "google-chrome"
} else {
name = "Chromium"
filename = "chromium-browser"
confdir = "chromium"
}
script = "//chrome/tools/build/linux/sed.py"
infile = "app/resources/manpage.1.in"
inputs = [
infile,
]
outfile = "$root_out_dir/chrome.1"
outputs = [
outfile,
]
args = [
rebase_path(infile, root_build_dir),
rebase_path(outfile, root_build_dir),
"-e s/@@NAME@@/$name/",
"-e s/@@FILENAME@@/$filename/",
"-e s/@@CONFDIR@@/$confdir/",
]
}
if (is_official_build) {
action("linux_symbols") {
script = "//build/linux/dump_app_syms.py"
dump_syms_label = "//breakpad:dump_syms($host_toolchain)"
dump_syms_binary =
get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms"
chrome_binary = "$root_out_dir/chrome"
if (current_cpu == "x86") {
# Use "ia32" instead of "x86" for GYP compat.
symbol_file = "$root_out_dir/chrome.breakpad.ia32"
} else {
symbol_file = "$root_out_dir/chrome.breakpad.$current_cpu"
}
inputs = [
chrome_binary,
dump_syms_binary,
]
outputs = [
symbol_file,
]
args = [
"./" + rebase_path(dump_syms_binary, root_build_dir),
"0", # TODO(GYP) This is linux_strip_binary if it is needed.
rebase_path(chrome_binary, root_build_dir),
rebase_path(symbol_file, root_build_dir),
]
deps = [
":chrome",
dump_syms_label,
]
}
}
# Copies some scripts and resources that are used for desktop integration.
copy("xdg_mime") {
sources = [
"//chrome/app/theme/$branding_path_component/product_logo_48.png",
"//chrome/tools/build/linux/chrome-wrapper",
"//third_party/xdg-utils/scripts/xdg-mime",
"//third_party/xdg-utils/scripts/xdg-settings",
]
outputs = [
"$root_out_dir/{{source_file_part}}",
]
}
}