1 # Copyright 2014 The Chromium Authors. All rights reserved.
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/features.gni")
6 import("//build/config/locales.gni")
7 import("//build/config/ui.gni")
8 import("//chrome/chrome_repack_locales.gni")
9 import("//chrome/version.gni")
11 # TODO(GYP) for Windows need to the the reorder-imports step which probably
12 # means adding another target and renaming this to chrome_initial like in GYP.
13 executable("chrome") {
14 # Because the sources list varies so significantly per-platform, generally
15 # each platform lists its own files rather than relying on filtering or
16 # removing unused files.
18 "app/chrome_exe_resource.h",
23 # TODO(GYP) mac_bundle_resources, xcode_settings
25 # TODO(GYP) order_profiling, order_text_section
29 "app/chrome_exe_main_win.cc",
32 "app/signature_validator_win.cc",
33 "app/signature_validator_win.h",
34 "//content/app/startup_helper_win.cc",
36 deps += [ "//ui/gfx" ]
37 } else if (use_aura) {
38 # Non-Windows aura entrypoint.
39 sources += [ "app/chrome_exe_main_aura.cc" ]
43 # TODO(GYP) manpage action
46 "app/chrome_dll_resource.h",
48 "app/chrome_main_delegate.cc",
49 "app/chrome_main_delegate.h",
53 # On Linux, link the dependencies (libraries) that make up actual
54 # Chromium functionality directly into the executable.
55 ":browser_dependencies",
56 ":child_dependencies",
59 # Needed to use the master_preferences functions
60 "//chrome/installer/util",
64 # Needed for chrome_main.cc initialization of libraries.
65 configs += [ "//build/config/linux:pangocairo" ]
67 # TODO(GYP) ['profiling==0 and linux_disable_pie==0', {
75 "//build/config/linux:x11",
76 "//build/config/linux:xext",
83 "app/chrome_exe_main_mac.cc",
85 # TODO(GYP) lots more stuff in the is_mac block.
88 ":packed_extra_resources",
91 # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp
92 # file decide what to do on a per-OS basis; on Mac, internal plugins
93 # go inside the framework, so this dependency is in chrome_dll.gypi.
94 #'../third_party/adobe/flash/flash_player.gyp:flapper_binaries', TODO(GYP)
96 # Copy CDM files to PRODUCT_DIR if applicable. Let the .gyp
97 # file decide what to do on a per-OS basis; on Mac, internal plugins
98 # go inside the framework, so this dependency is in chrome_dll.gypi.
99 #'../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter', TODO(GYP)
102 # TODO(GYP) some stuff from GYP including chrome_multiple_dll.
107 if (!is_mac && !is_android) {
108 # On Mac this is done in chrome_dll.gypi. Android doesn't use pdfium.
109 datadeps += [ "//pdf" ]
111 # TODO(GYP) pdf linux symbols
115 shared_library("main_dll") {
116 configs += [ "//build/config/compiler:wexit_time_destructors" ]
119 ":browser_dependencies",
123 output_name = "chrome"
126 "app/chrome_command_ids.h",
128 "app/chrome_dll_resource.h",
129 "app/chrome_main.cc",
130 "app/chrome_main_delegate.cc",
131 "app/chrome_main_delegate.h",
132 "app/close_handle_hook_win.cc",
133 "app/close_handle_hook_win.h",
134 "app/delay_load_hook_win.cc",
135 "app/delay_load_hook_win.h",
136 "//base/win/dllmain.cc",
140 # On Windows, link the dependencies (libraries) that make up actual
141 # Chromium functionality into this .dll.
142 #'chrome_version_resources', TODO(GYP)
143 "//chrome/app/theme:chrome_unscaled_resources",
144 "//content/app/resources",
146 "//net:net_resources",
149 #'<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf' ] TODO(GYP)
151 if (enable_configuration_policy) {
152 deps += [ "//components/policy" ]
154 if (cpu_arch == "x86") {
155 # Add a dependency to custom import library for user32 delay imports only
157 #deps += [ 'chrome_user32_delay_imports' ] TODO(GYP)
160 # TODO(GYP) incremental linking flags in debug builds
161 #'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
163 # TODO(GYP) Lots of VCLinkerTool stuff on Windows.
165 # TODO(GYP) chrome_pgo_phase on Windows.
169 deps += [ "//ui/compositor" ]
172 #TODO(GYP) add chrome_multiple_dll support
173 if (false) { #chrome_multiple_dll) {
174 defines = [ "CHROME_MULTIPLE_DLL_BROWSER" ]
176 "//content/app:browser",
180 ":child_dependencies",
181 "//content/app:both",
185 if (cld_version == 0 || cld_version == 2) {
187 "//third_party/cld_2",
192 #['OS=="mac" and component!="shared_library"', { TODO(GYP)
193 # 'includes': [ 'chrome_dll_bundle.gypi' ],
196 # TODO(GYP) Lots of other stuff in the OS=="mac" block.
200 # GYP version: chromium_browser_dependencies variable in chrome.gyp
201 group("browser_dependencies") {
209 "//ppapi:ppapi_host",
213 if (printing_mode != 0) {
214 deps += [ "//printing" ]
215 if (printing_mode == 1) {
216 deps += [ "//chrome/service" ]
221 # GYP version: chromium_child_dependencies variable in chrome.gyp
222 group("child_dependencies") {
229 "//chrome/browser/devtools",
234 "//content/ppapi_plugin",
235 "//third_party/WebKit/public:blink_devtools_frontend_resources",
241 # TODO(brettw) this duplicates "//chrome/common:version" which applies to
243 process_version("version_header") {
244 # TODO(brettW) this should have more reduced visibility, but chrome/browser
245 # currently depends on this.
247 source = "version.h.in"
248 # TODO(brettw) this should move to $target_gen_dir/version.h and
249 # source files including it should reference it via "chrome/version.h"
250 output = "$root_gen_dir/version.h"
254 # GYP version: chrome/chrome_resources.gyp:chrome_resources
257 # Note: GYP lists some dependencies in addition to these actions. However,
258 # these are just dependencies for the actions themselves, which our actions
259 # list individually when needed.
260 "//chrome/browser:resources",
261 "//chrome/common:resources",
262 "//chrome/renderer:resources",
265 if (enable_extensions) {
266 deps += [ "//chrome/common:extensions_api_resources" ]
270 # GYP version: chrome/chrome_resources.gyp:chrome_extra_resources
271 group("extra_resources") {
273 "//chrome/browser/resources:invalidations_resources",
274 "//chrome/browser/resources:memory_internals_resources",
275 "//chrome/browser/resources:net_internals_resources",
276 "//chrome/browser/resources:password_manager_internals_resources",
277 "//chrome/browser/resources:signin_internals_resources",
278 "//chrome/browser/resources:sync_internals_resources",
279 "//chrome/browser/resources:translate_internals_resources",
283 "//chrome/browser/resources:component_extension_resources",
284 "//chrome/browser/resources:options_resources",
288 if (enable_chromevox_next) {
290 #'browser/resources/chromeos/chromevox2/chromevox.gyp:chromevox2', TODO(GYP)
294 #'browser/resources/chromeos/chromevox/chromevox.gyp:chromevox', TODO(GYP)
298 if (enable_extensions) {
300 "//chrome/browser/resources:quota_internals_resources",
301 "//chrome/browser/resources:sync_file_system_internals_resources",
306 group("packed_resources") {
308 ":repack_locales_pack",
309 ":repack_pseudo_locales_pack",
310 ":repack_chrome_100_percent",
313 # TODO(GYP) if (is_chrome_branded) {
314 # ... copy default_apps from default_apps_list
317 deps += [ ":repack_chrome_200_percent" ]
321 repack("packed_extra_resources") {
324 "$root_gen_dir/chrome/browser_resources.pak",
325 "$root_gen_dir/chrome/app/theme/chrome_unscaled_resources.pak",
326 "$root_gen_dir/chrome/common_resources.pak",
327 "$root_gen_dir/chrome/browser/resources/invalidations_resources.pak",
328 "$root_gen_dir/chrome/browser/resources/memory_internals_resources.pak",
329 "$root_gen_dir/chrome/browser/resources/net_internals_resources.pak",
330 "$root_gen_dir/chrome/browser/resources/password_manager_internals_resources.pak",
331 "$root_gen_dir/chrome/browser/resources/signin_internals_resources.pak",
332 "$root_gen_dir/chrome/browser/resources/sync_internals_resources.pak",
333 "$root_gen_dir/chrome/browser/resources/translate_internals_resources.pak",
334 "$root_gen_dir/components/resources/component_resources.pak",
335 "$root_gen_dir/net/net_resources.pak",
336 "$root_gen_dir/ui/resources/webui_resources.pak",
339 "//chrome/browser:resources",
340 "//chrome/app/theme:chrome_unscaled_resources",
341 "//chrome/common:resources",
342 "//chrome/browser/resources:invalidations_resources",
343 "//chrome/browser/resources:memory_internals_resources",
344 "//chrome/browser/resources:net_internals_resources",
345 "//chrome/browser/resources:password_manager_internals_resources",
346 "//chrome/browser/resources:signin_internals_resources",
347 "//chrome/browser/resources:sync_internals_resources",
348 "//chrome/browser/resources:translate_internals_resources",
349 "//components/resources",
350 "//net:net_resources",
354 if (!is_ios && !is_android) {
355 # New paks should be added here by default.
357 "$root_gen_dir/webkit/devtools_resources.pak",
358 "$root_gen_dir/chrome/browser/resources/component_extension_resources.pak",
359 "$root_gen_dir/chrome/browser/resources/options_resources.pak",
360 "$root_gen_dir/chrome/browser/resources/quota_internals_resources.pak",
361 "$root_gen_dir/chrome/browser/resources/sync_file_system_internals_resources.pak",
364 "//content/browser/devtools:devtools_resources",
365 "//chrome/browser/resources:component_extension_resources",
366 "//chrome/browser/resources:options_resources",
367 "//chrome/browser/resources:quota_internals_resources",
368 "//chrome/browser/resources:sync_file_system_internals_resources",
373 "$root_gen_dir/blink/public/resources/blink_resources.pak",
374 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
375 "$root_gen_dir/content/content_resources.pak",
376 "$root_gen_dir/extensions/extensions_renderer_resources.pak",
377 "$root_gen_dir/extensions/extensions_resources.pak",
381 sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ]
382 deps += [ "//ui/file_manager:resources" ]
384 if (enable_extensions) {
385 sources += [ "$root_gen_dir/chrome/extensions_api_resources.pak" ]
386 deps += [ "//chrome/common:extensions_api_resources" ]
389 # GYP outputs the file in the gen/repack directory. On non-Mac/iOS platforms
390 # it them copies it. This skipes the copy step and writes it to the final
392 if (is_mac || is_ios) {
393 output = "$root_gen_dir/repack/resources.pak"
395 output = "$root_out_dir/resources.pak"
399 # Collects per-locale grit files from many sources into global per-locale files.
400 chrome_repack_locales("repack_locales_pack") {
403 input_locales = locales
406 output_locales = locales_as_mac_outputs
408 output_locales = locales
412 chrome_repack_locales("repack_pseudo_locales_pack") {
415 input_locales = [ "fake-bidi" ]
418 output_locales = [ "fake_bidi" ] # Mac uses underscores.
420 output_locales = [ "fake-bidi" ]
424 # Generates a rule to repack a set of resources, substituting a given string
425 # in for the percentage (e.g. "100", "200"). It generates the repacked files in
426 # the "gen" directory, and then introduces a copy rule to copy it to the root
429 # It's not clear why this two-step dance is necessary as opposed to just
430 # generating the file in the destination. However, this is what the GYP build
431 # does, and for maintenance purposes, this keeps the same files in the same
432 # place between the two builds when possible.
436 # String to substitute for the percentage.
437 template("chrome_repack_percent") {
438 percent = invoker.percent
440 repack_name = "${target_name}_repack"
441 repack_output_file = "$root_gen_dir/repack/chrome_${percent}_percent.pak"
443 copy_name = target_name
445 repack(repack_name) {
446 visibility = ":$copy_name"
447 # All sources should also have deps for completeness.
449 "$root_gen_dir/components/resources/component_resources_${percent}_percent.pak",
450 "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak",
451 "$root_gen_dir/chrome/renderer_resources_${percent}_percent.pak",
452 "$root_gen_dir/chrome/app/theme/theme_resources_${percent}_percent.pak",
456 "//chrome/app/theme:theme_resources",
457 "//chrome/renderer:resources",
458 "//components/strings",
459 "//net:net_resources",
464 "$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak",
466 deps += [ "//content:resources" ]
469 sources += [ "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak" ]
470 deps += [ "//ash/resources" ]
474 "$root_gen_dir/athena/resources/athena_resources_${percent}_percent.pak",
476 deps += [ "//athena/resources" ]
480 "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak",
482 deps += [ "//ui/chromeos/resources" ]
485 output = repack_output_file
490 deps = [ ":$repack_name" ]
491 sources = [ repack_output_file ]
492 outputs = [ "$root_build_dir/chrome_${percent}_percent.pak" ]
496 chrome_repack_percent("repack_chrome_100_percent") {
501 chrome_repack_percent("repack_chrome_200_percent") {
506 # GYP version: chrome/chrome_resources.gyp:chrome_strings
509 "//chrome/app:chromium_strings",
510 "//chrome/app:generated_resources",
511 "//chrome/app:google_chrome_strings",
512 "//chrome/app/resources:locale_settings",