1 # Copyright (c) 2012 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.
8 'target_name': 'chrome',
10 'dependencies': [ 'chrome_initial', ],
12 ['OS=="linux" and clang_type_profiler==1', {
14 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
21 'reorder_py_path': '<(DEPTH)/build/win/reorder-imports.py',
22 # See comment in chrome_dll.gypi in the hardlink_to_output
23 # target for why this cannot be 'initial' like the DLL.
24 'exe_input_path':'$(OutDir)\\initialexe',
25 'exe_output_path':'<(PRODUCT_DIR)',
27 'action_name': 'reorder_imports',
30 '$(OutDir)\\initialexe\\chrome.exe',
33 '<(PRODUCT_DIR)\\chrome.exe',
34 '<(PRODUCT_DIR)\\chrome.exe.pdb',
39 '-i', '<(exe_input_path)',
40 '-o', '<(exe_output_path)',
41 '-a', '<(target_arch)',
43 'message': 'Reordering Imports',
50 # GN version: //chrome
51 'target_name': 'chrome_initial',
53 # Name the exe chrome.exe, not chrome_initial.exe.
54 'product_name': 'chrome',
57 'use_system_xdg_utils%': 0,
58 'enable_wexit_time_destructors': 1,
61 # Note that due to InitializeSandboxInfo, this must be directly linked
62 # into chrome.exe, not into a dependent.
63 '<(DEPTH)/content/app/startup_helper_win.cc',
64 '<(DEPTH)/content/public/common/content_switches.cc',
65 'app/chrome_exe_main_aura.cc',
66 'app/chrome_exe_main_mac.cc',
67 'app/chrome_exe_main_win.cc',
68 'app/chrome_exe_resource.h',
69 'app/chrome_watcher_client_win.cc',
70 'app/chrome_watcher_client_win.h',
71 'app/chrome_watcher_command_line_win.cc',
72 'app/chrome_watcher_command_line_win.h',
75 'app/kasko_client.cc',
77 'app/signature_validator_win.cc',
78 'app/signature_validator_win.h',
80 'mac_bundle_resources': [
83 # TODO(mark): Come up with a fancier way to do this. It should only
84 # be necessary to list app-Info.plist once, not the three times it is
86 'mac_bundle_resources!': [
90 'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves',
91 'INFOPLIST_FILE': 'app/app-Info.plist',
94 ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
96 '../tools/cygprofile/cygprofile.gyp:cygprofile',
99 ['order_text_section!=""', {
100 'target_conditions' : [
101 ['_toolset=="target"', {
103 '-Wl,-section-ordering-file=<(order_text_section)' ],
110 'chrome_watcher_client',
111 '../components/components.gyp:browser_watcher_client',
121 ['OS == "android"', {
122 # Don't put the 'chrome' target in 'all' on android
123 'suppress_wildcard': 1,
125 ['os_posix == 1 and OS != "mac" and OS != "android"', {
128 'action_name': 'manpage',
130 [ 'branding == "Chrome"', {
132 'name': 'Google Chrome',
133 'filename': 'google-chrome',
134 'confdir': 'google-chrome',
136 }, { # else branding!="Chrome"
139 'filename': 'chromium-browser',
140 'confdir': 'chromium',
145 'tools/build/linux/sed.py',
146 'app/resources/manpage.1.in',
149 '<(PRODUCT_DIR)/chrome.1',
153 'tools/build/linux/sed.py',
154 'app/resources/manpage.1.in',
156 '-e', 's/@@NAME@@/<(name)/',
157 '-e', 's/@@FILENAME@@/<(filename)/',
158 '-e', 's/@@CONFDIR@@/<(confdir)/',
160 'message': 'Generating manpage'
164 ['use_allocator!="none"', {
166 '<(allocator_target)',
170 ['profiling==0 and linux_disable_pie==0', {
175 ['use_system_xdg_utils==0', {
178 'destination': '<(PRODUCT_DIR)',
179 'files': ['tools/build/linux/chrome-wrapper',
180 '../third_party/xdg-utils/scripts/xdg-mime',
181 '../third_party/xdg-utils/scripts/xdg-settings',
183 # The wrapper script above may need to generate a .desktop
184 # file, which requires an icon. So, copy one next to the
187 ['branding=="Chrome"', {
188 'files': ['app/theme/google_chrome/product_logo_48.png']
189 }, { # else: 'branding!="Chrome"
190 'files': ['app/theme/chromium/product_logo_48.png']
196 # x11 build. Needed for chrome_main.cc initialization of libraries.
199 '../build/linux/system.gyp:x11',
200 '../build/linux/system.gyp:xext',
203 ['OS=="linux" and enable_plugins==1', {
205 '../pdf/pdf.gyp:pdf',
210 'app/chrome_dll_resource.h',
211 'app/chrome_main.cc',
212 'app/chrome_main_delegate.cc',
213 'app/chrome_main_delegate.h',
216 # On Linux, link the dependencies (libraries) that make up actual
217 # Chromium functionality directly into the executable.
218 '<@(chromium_browser_dependencies)',
219 '<@(chromium_child_dependencies)',
220 '../content/content.gyp:content_app_both',
221 # Needed for chrome_main.cc initialization of libraries.
222 '../build/linux/system.gyp:pangocairo',
223 # Needed to use the master_preferences functions
228 # 'branding' is a variable defined in common.gypi
229 # (e.g. "Chromium", "Chrome")
231 ['branding=="Chrome"', {
232 'mac_bundle_resources': [
233 'app/theme/google_chrome/mac/app.icns',
234 'app/theme/google_chrome/mac/document.icns',
235 'browser/ui/cocoa/applescript/scripting.sdef',
237 }, { # else: 'branding!="Chrome"
238 'mac_bundle_resources': [
239 'app/theme/chromium/mac/app.icns',
240 'app/theme/chromium/mac/document.icns',
241 'browser/ui/cocoa/applescript/scripting.sdef',
244 ['mac_breakpad==1', {
246 # A real .dSYM is needed for dump_syms to operate on.
250 # With mac_real_dsym set, strip_from_xcode won't be used.
251 # Specify CHROMIUM_STRIP_SAVE_FILE directly to Xcode.
252 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
255 '../breakpad/breakpad.gyp:dump_syms',
256 '../breakpad/breakpad.gyp:symupload',
258 # The "Dump Symbols" post-build step is in a target_conditions
259 # block so that it will follow the "Strip If Needed" step if that
260 # is also being used. There is no standard configuration where
261 # both of these steps occur together, but Mark likes to use this
262 # configuration sometimes when testing Breakpad-enabled builds
263 # without the time overhead of creating real .dSYM files. When
264 # both "Dump Symbols" and "Strip If Needed" are present, "Dump
265 # Symbols" must come second because "Strip If Needed" creates
266 # a fake .dSYM that dump_syms needs to fake dump. Since
267 # "Strip If Needed" is added in a target_conditions block in
268 # common.gypi, "Dump Symbols" needs to be in an (always true)
269 # target_conditions block.
270 'target_conditions': [
274 'postbuild_name': 'Dump Symbols',
276 'dump_product_syms_path':
277 'tools/build/mac/dump_product_syms',
279 'action': ['<(dump_product_syms_path)',
287 'product_name': '<(mac_product_name)',
289 # chrome/app/app-Info.plist has:
290 # CFBundleIdentifier of CHROMIUM_BUNDLE_ID
291 # CFBundleName of CHROMIUM_SHORT_NAME
292 # CFBundleSignature of CHROMIUM_CREATOR
293 # Xcode then replaces these values with the branded values we set
294 # as settings on the target.
295 'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
296 'CHROMIUM_CREATOR': '<(mac_creator)',
297 'CHROMIUM_SHORT_NAME': '<(branding)',
300 '../components/components.gyp:chrome_manifest_bundle',
302 'infoplist_strings_tool',
303 # On Mac, make sure we've built chrome_dll, which contains all of
304 # the library code with Chromium functionality.
307 'mac_bundle_resources': [
308 '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
312 # Generate the InfoPlist.strings file
313 'action_name': 'Generate InfoPlist.strings files',
315 'tool_path': '<(PRODUCT_DIR)/infoplist_strings_tool',
316 # Unique dir to write to so the [lang].lproj/InfoPlist.strings
317 # for the main app and the helper app don't name collide.
318 'output_path': '<(INTERMEDIATE_DIR)/app_infoplist_strings',
319 'branding_name': '<(branding_path_component)_strings',
324 # TODO: remove this helper when we have loops in GYP
325 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
328 # TODO: remove this helper when we have loops in GYP
329 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
333 '-b', '<(branding_name)',
334 '-v', '<(version_path)',
335 '-g', '<(grit_out_dir)',
336 '-o', '<(output_path)',
340 'message': 'Generating the language InfoPlist.strings files',
341 'process_outputs_as_mac_bundle_resources': 1,
346 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
348 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
354 'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
356 '../build/mac/copy_framework_unversioned.sh',
357 '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Framework.framework',
358 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Versions/<(version_full)',
362 # Modify the Info.plist as needed. The script explains why this
363 # is needed. This is also done in the helper_app and chrome_dll
364 # targets. Use --breakpad=0 to not include any Breakpad
365 # information; that all goes into the framework's Info.plist.
366 # Keystone information is included if Keystone is enabled. The
367 # application reads Keystone keys from this plist and not the
368 # framework's, and the ticket will reference this Info.plist to
369 # determine the tag of the installed product. Use --scm=1 to
370 # include SCM information.
371 'postbuild_name': 'Tweak Info.plist',
372 'action': ['<(tweak_info_plist_path)',
374 '--keystone=<(mac_keystone)',
376 '--bundle_id=<(mac_bundle_id)'],
379 'postbuild_name': 'Clean up old versions',
381 'tools/build/mac/clean_up_old_versions',
386 # This postbuid step is responsible for creating the following
389 # For unofficial Chromium branding, Chromium Helper EH.app and
390 # Chromium Helper NP.app are created from Chromium Helper.app.
391 # For official Google Chrome branding, Google Chrome Helper
392 # EH.app and Google Chrome Helper NP.app are created from
393 # Google Chrome Helper.app.
395 # The EH helper is marked for an executable heap. The NP helper
396 # is marked for no PIE (ASLR).
398 # Normally, applications shipping as part of offical builds with
399 # Google Chrome branding have dsymutil (dwarf-with-dsym,
400 # mac_real_dsym) and dump_syms (mac_breakpad) run on them to
401 # produce a .dSYM bundle and a Breakpad .sym file. This is
402 # unnecessary for the "More Helpers" because they're identical
403 # to the original helper except for the bits in their Mach-O
404 # headers that change to enable or disable special features.
405 # Each .dSYM is identified by UUID stored in a Mach-O file's
406 # LC_UUID load command. Because the "More Helpers" share a UUID
407 # with the original helper, there's no need to run dsymutil
408 # again. All helpers can share the same .dSYM. Special handling
409 # is performed in chrome/tools/build/mac/dump_product_syms to
410 # prepare their Breakpad symbol files.
411 'postbuild_name': 'Make More Helpers',
413 '../build/mac/make_more_helpers.sh',
414 'Versions/<(version_full)',
415 '<(mac_product_name)',
419 # Make sure there isn't any Objective-C in the browser app's
421 'postbuild_name': 'Verify No Objective-C',
423 '../build/mac/verify_no_objc.sh',
430 # 'product_name': 'chromium'
431 # whenever we convert the rest of the infrastructure
432 # (buildbots etc.) to understand the branding gyp define.
433 # NOTE: chrome/app/theme/chromium/BRANDING and
434 # chrome/app/theme/google_chrome/BRANDING have the short name
435 # "chrome" etc.; should we try to extract from there instead?
438 '../components/components.gyp:startup_metric_utils',
439 'chrome_resources.gyp:packed_extra_resources',
440 'chrome_resources.gyp:packed_resources',
441 # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp
442 # file decide what to do on a per-OS basis; on Mac, internal plugins
443 # go inside the framework, so this dependency is in chrome_dll.gypi.
444 '../third_party/adobe/flash/flash_player.gyp:flapper_binaries',
445 # Copy CDM files to PRODUCT_DIR if applicable. Let the .gyp
446 # file decide what to do on a per-OS basis; on Mac, internal plugins
447 # go inside the framework, so this dependency is in chrome_dll.gypi.
448 '../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
451 ['chrome_multiple_dll', {
452 'defines': ['CHROME_MULTIPLE_DLL'],
456 ['branding=="Chrome"', {
458 'linux_installer_configs',
461 # For now, do not build nacl_helper when disable_nacl=1
462 # http://code.google.com/p/gyp/issues/detail?id=239
463 ['disable_nacl==0', {
465 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
466 '../components/nacl.gyp:nacl_helper',
467 '../components/nacl_nonsfi.gyp:nacl_helper_nonsfi',
472 '../sandbox/sandbox.gyp:sandbox',
479 'chrome_process_finder',
480 'chrome_version_resources',
483 '../base/base.gyp:base',
484 '../crypto/crypto.gyp:crypto',
485 '../breakpad/breakpad.gyp:breakpad_handler',
486 '../breakpad/breakpad.gyp:breakpad_sender',
487 '../chrome_elf/chrome_elf.gyp:chrome_elf',
488 '../components/components.gyp:crash_component',
489 '../sandbox/sandbox.gyp:sandbox',
490 '../ui/gfx/gfx.gyp:gfx',
491 '../win8/metro_driver/metro_driver.gyp:metro_driver',
492 '../win8/delegate_execute/delegate_execute.gyp:*',
495 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
496 'app/chrome_crash_reporter_client.cc',
497 'app/chrome_crash_reporter_client.h',
499 'common/crash_keys.cc',
500 'common/crash_keys.h',
503 # We still want the _win entry point for sandbox, etc.
504 'app/chrome_exe_main_aura.cc',
508 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
509 'OutputFile': '$(OutDir)\\initialexe\\chrome.exe',
517 'AdditionalDependencies': [
523 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself, except for the
524 # AddressSanitizer build where console output is important.
530 'AdditionalManifestFiles': [
531 '$(ProjectDir)\\app\\chrome.exe.manifest',
532 '<(SHARED_INTERMEDIATE_DIR)/chrome/app/version_assembly/version_assembly.manifest',
537 ['configuration_policy==1', {
539 '<(DEPTH)/components/components.gyp:policy',
545 'action_name': 'first_run',
550 '<(PRODUCT_DIR)/First Run',
552 'action': ['python', '../build/cp.py', '<@(_inputs)', '<@(_outputs)'],
553 'message': 'Copy first run complete sentinel file',
556 'action_name': 'chrome_exe_manifest',
558 'app/version_assembly/chrome_exe_manifest_action.gypi',
562 'action_name': 'version_assembly_manifest',
564 'app/version_assembly/version_assembly_manifest_action.gypi',
570 'app/client_util.cc',
573 ['OS=="win" and component=="shared_library"', {
574 'defines': ['COMPILE_CONTENT_STATICALLY'],
583 'target_name': 'image_pre_reader',
584 'type': 'static_library',
586 'app/image_pre_reader_win.cc',
587 'app/image_pre_reader_win.h',
590 '../base/base.gyp:base',
595 ['disable_nacl!=1 and target_arch=="ia32"', {
598 'target_name': 'chrome_nacl_win64',
599 'type': 'executable',
600 'product_name': 'nacl64',
602 '../content/app/startup_helper_win.cc',
603 '../content/common/sandbox_init_win.cc',
604 '../content/common/sandbox_win.cc',
605 '../content/public/common/content_switches.cc',
606 '../content/public/common/sandboxed_process_launcher_delegate.cc',
607 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/nacl64_exe_version.rc',
608 'app/chrome_crash_reporter_client.cc',
609 'common/crash_keys.cc',
610 'nacl/nacl_exe_win_64.cc',
613 'chrome_version_resources',
614 'installer_util_nacl_win64',
615 '../base/base.gyp:base_i18n_nacl_win64',
616 '../base/base.gyp:base_win64',
617 '../base/base.gyp:base_static_win64',
618 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
619 '../breakpad/breakpad.gyp:breakpad_handler_win64',
620 '../breakpad/breakpad.gyp:breakpad_sender_win64',
621 '../components/components.gyp:breakpad_win64',
622 '../chrome/common_constants.gyp:common_constants_win64',
623 '../components/nacl.gyp:nacl_win64',
624 '../crypto/crypto.gyp:crypto_nacl_win64',
625 '../ipc/ipc.gyp:ipc_win64',
626 '../sandbox/sandbox.gyp:sandbox_win64',
629 '<@(nacl_win64_defines)',
630 'COMPILE_CONTENT_STATICALLY',
633 '<(SHARED_INTERMEDIATE_DIR)/chrome',
637 'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
638 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
643 'msvs_target_platform': 'x64',
647 ['configuration_policy==1', {
649 '<(DEPTH)/components/components.gyp:policy_win64',
655 }, { # else (disable_nacl==1)
658 'target_name': 'chrome_nacl_win64',
666 ['test_isolation_mode != "noop"', {
669 'target_name': 'chrome_run',
673 # Runtime dependencies
674 '../third_party/mesa/mesa.gyp:osmesa',
677 '../build/isolate.gypi',