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', ],
16 'reorder_py_path': '<(DEPTH)/build/win/reorder-imports.py',
17 'exe_input_path':'$(OutDir)\\initial',
18 'exe_output_path':'<(PRODUCT_DIR)',
20 'action_name': 'reorder_imports',
25 '<(PRODUCT_DIR)\\chrome.exe',
26 '<(PRODUCT_DIR)\\chrome.exe.pdb',
31 '-i', '<(exe_input_path)',
32 '-o', '<(exe_output_path)',
33 '-a', '<(target_arch)',
35 'message': 'Reordering Imports',
42 'target_name': 'chrome_initial',
44 # Name the exe chrome.exe, not chrome_initial.exe.
45 'product_name': 'chrome',
48 'use_system_xdg_utils%': 0,
49 'enable_wexit_time_destructors': 1,
52 'app/chrome_exe_main_aura.cc',
53 'app/chrome_exe_main_gtk.cc',
54 'app/chrome_exe_main_mac.cc',
55 'app/chrome_exe_main_win.cc',
56 'app/chrome_exe_resource.h',
59 'app/metro_driver_win.cc',
60 'app/metro_driver_win.h',
61 'app/signature_validator_win.cc',
62 'app/signature_validator_win.h',
63 '<(DEPTH)/content/app/startup_helper_win.cc',
64 '<(DEPTH)/content/public/common/content_switches.cc',
66 'mac_bundle_resources': [
69 # TODO(mark): Come up with a fancier way to do this. It should only
70 # be necessary to list app-Info.plist once, not the three times it is
72 'mac_bundle_resources!': [
76 'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves',
77 'INFOPLIST_FILE': 'app/app-Info.plist',
80 ['component == "shared_library"', {
82 'win_use_external_manifest': 1,
85 ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
87 '../tools/cygprofile/cygprofile.gyp:cygprofile',
90 ['order_text_section!=""', {
91 'target_conditions' : [
92 ['_toolset=="target"', {
94 '-Wl,-section-ordering-file=<(order_text_section)' ],
98 ['OS == "win" and use_aura==1', {
100 # We still want the _win entry point for sandbox, etc.
101 'app/chrome_exe_main_aura.cc',
104 '../ui/gfx/gfx.gyp:gfx',
107 ['OS == "android"', {
108 # Don't put the 'chrome' target in 'all' on android
109 'suppress_wildcard': 1,
111 ['os_posix == 1 and OS != "mac" and OS != "android"', {
114 'action_name': 'manpage',
116 [ 'branding == "Chrome"', {
118 'name': 'Google Chrome',
119 'filename': 'google-chrome',
120 'confdir': 'google-chrome',
122 }, { # else branding!="Chrome"
125 'filename': 'chromium-browser',
126 'confdir': 'chromium',
131 'tools/build/linux/sed.sh',
132 'app/resources/manpage.1.in',
135 '<(PRODUCT_DIR)/chrome.1',
138 'tools/build/linux/sed.sh',
139 'app/resources/manpage.1.in',
141 '-e', 's/@@NAME@@/<(name)/',
142 '-e', 's/@@FILENAME@@/<(filename)/',
143 '-e', 's/@@CONFDIR@@/<(confdir)/',
145 'message': 'Generating manpage'
149 ['linux_use_tcmalloc==1', {
151 '<(allocator_target)',
155 ['profiling==0 and linux_disable_pie==0', {
160 ['use_system_xdg_utils==0', {
163 'destination': '<(PRODUCT_DIR)',
164 'files': ['tools/build/linux/chrome-wrapper',
165 '../third_party/xdg-utils/scripts/xdg-mime',
166 '../third_party/xdg-utils/scripts/xdg-settings',
168 # The wrapper script above may need to generate a .desktop
169 # file, which requires an icon. So, copy one next to the
172 ['branding=="Chrome"', {
173 'files': ['app/theme/google_chrome/product_logo_48.png']
174 }, { # else: 'branding!="Chrome"
175 'files': ['app/theme/chromium/product_logo_48.png']
181 ['toolkit_uses_gtk == 1', {
183 # On Linux, link the dependencies (libraries) that make up actual
184 # Chromium functionality directly into the executable.
185 '<@(chromium_browser_dependencies)',
186 '<@(chromium_child_dependencies)',
187 '../content/content.gyp:content_app_both',
188 # Needed for chrome_main.cc initialization of libraries.
189 '../build/linux/system.gyp:gtk',
190 # Needed to use the master_preferences functions
193 }, { # else toolkit_uses_gtk == 1
195 # On Linux, link the dependencies (libraries) that make up actual
196 # Chromium functionality directly into the executable.
197 '<@(chromium_browser_dependencies)',
198 '<@(chromium_child_dependencies)',
199 '../content/content.gyp:content_app_both',
200 # Needed for chrome_main.cc initialization of libraries.
201 '../build/linux/system.gyp:x11',
202 '../build/linux/system.gyp:pangocairo',
203 '../build/linux/system.gyp:xext',
204 # Needed to use the master_preferences functions
210 'app/chrome_dll_resource.h',
211 'app/chrome_main.cc',
212 'app/chrome_main_delegate.cc',
213 'app/chrome_main_delegate.h',
217 # 'branding' is a variable defined in common.gypi
218 # (e.g. "Chromium", "Chrome")
220 ['branding=="Chrome"', {
221 'mac_bundle_resources': [
222 'app/theme/google_chrome/mac/app.icns',
223 'app/theme/google_chrome/mac/document.icns',
224 'browser/ui/cocoa/applescript/scripting.sdef',
226 }, { # else: 'branding!="Chrome"
227 'mac_bundle_resources': [
228 'app/theme/chromium/mac/app.icns',
229 'app/theme/chromium/mac/document.icns',
230 'browser/ui/cocoa/applescript/scripting.sdef',
233 ['mac_breakpad==1', {
235 # A real .dSYM is needed for dump_syms to operate on.
239 # With mac_real_dsym set, strip_from_xcode won't be used.
240 # Specify CHROMIUM_STRIP_SAVE_FILE directly to Xcode.
241 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
244 '../breakpad/breakpad.gyp:dump_syms',
245 '../breakpad/breakpad.gyp:symupload',
247 # In order to process symbols for the Remoting Host plugin,
248 # that plugin needs to be built beforehand. Since the
249 # "Dump Symbols" step hangs off this target, that plugin also
250 # needs to be added as a dependency.
251 '../remoting/remoting.gyp:remoting_host_plugin',
253 # The "Dump Symbols" post-build step is in a target_conditions
254 # block so that it will follow the "Strip If Needed" step if that
255 # is also being used. There is no standard configuration where
256 # both of these steps occur together, but Mark likes to use this
257 # configuration sometimes when testing Breakpad-enabled builds
258 # without the time overhead of creating real .dSYM files. When
259 # both "Dump Symbols" and "Strip If Needed" are present, "Dump
260 # Symbols" must come second because "Strip If Needed" creates
261 # a fake .dSYM that dump_syms needs to fake dump. Since
262 # "Strip If Needed" is added in a target_conditions block in
263 # common.gypi, "Dump Symbols" needs to be in an (always true)
264 # target_conditions block.
265 'target_conditions': [
269 'postbuild_name': 'Dump Symbols',
271 'dump_product_syms_path':
272 'tools/build/mac/dump_product_syms',
274 'action': ['<(dump_product_syms_path)',
282 'product_name': '<(mac_product_name)',
284 # chrome/app/app-Info.plist has:
285 # CFBundleIdentifier of CHROMIUM_BUNDLE_ID
286 # CFBundleName of CHROMIUM_SHORT_NAME
287 # CFBundleSignature of CHROMIUM_CREATOR
288 # Xcode then replaces these values with the branded values we set
289 # as settings on the target.
290 'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
291 'CHROMIUM_CREATOR': '<(mac_creator)',
292 'CHROMIUM_SHORT_NAME': '<(branding)',
295 '../components/components.gyp:chrome_manifest_bundle',
297 'infoplist_strings_tool',
298 'interpose_dependency_shim',
299 # On Mac, make sure we've built chrome_dll, which contains all of
300 # the library code with Chromium functionality.
303 'mac_bundle_resources': [
304 '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
308 # Generate the InfoPlist.strings file
309 'action_name': 'Generate InfoPlist.strings files',
311 'tool_path': '<(PRODUCT_DIR)/infoplist_strings_tool',
312 # Unique dir to write to so the [lang].lproj/InfoPlist.strings
313 # for the main app and the helper app don't name collide.
314 'output_path': '<(INTERMEDIATE_DIR)/app_infoplist_strings',
317 [ 'branding == "Chrome"', {
319 'branding_name': 'google_chrome_strings',
321 }, { # else branding!="Chrome"
323 'branding_name': 'chromium_strings',
330 # TODO: remove this helper when we have loops in GYP
331 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
334 # TODO: remove this helper when we have loops in GYP
335 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
339 '-b', '<(branding_name)',
340 '-v', '<(version_path)',
341 '-g', '<(grit_out_dir)',
342 '-o', '<(output_path)',
346 'message': 'Generating the language InfoPlist.strings files',
347 'process_outputs_as_mac_bundle_resources': 1,
352 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
354 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
355 '<(PRODUCT_DIR)/libplugin_carbon_interpose.dylib',
361 'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
363 '../build/mac/copy_framework_unversioned.sh',
364 '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Framework.framework',
365 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Versions/<(version_full)',
369 # Modify the Info.plist as needed. The script explains why this
370 # is needed. This is also done in the helper_app and chrome_dll
371 # targets. Use --breakpad=0 to not include any Breakpad
372 # information; that all goes into the framework's Info.plist.
373 # Keystone information is included if Keystone is enabled. The
374 # application reads Keystone keys from this plist and not the
375 # framework's, and the ticket will reference this Info.plist to
376 # determine the tag of the installed product. Use --scm=1 to
377 # include SCM information. The --pdf flag controls whether
378 # to insert PDF as a supported type identifier that can be
380 'postbuild_name': 'Tweak Info.plist',
381 'action': ['<(tweak_info_plist_path)',
383 '--keystone=<(mac_keystone)',
385 '--pdf=<(internal_pdf)',
386 '--bundle_id=<(mac_bundle_id)'],
389 'postbuild_name': 'Clean up old versions',
391 'tools/build/mac/clean_up_old_versions',
396 # This postbuid step is responsible for creating the following
399 # For unofficial Chromium branding, Chromium Helper EH.app and
400 # Chromium Helper NP.app are created from Chromium Helper.app.
401 # For official Google Chrome branding, Google Chrome Helper
402 # EH.app and Google Chrome Helper NP.app are created from
403 # Google Chrome Helper.app.
405 # The EH helper is marked for an executable heap. The NP helper
406 # is marked for no PIE (ASLR).
408 # Normally, applications shipping as part of offical builds with
409 # Google Chrome branding have dsymutil (dwarf-with-dsym,
410 # mac_real_dsym) and dump_syms (mac_breakpad) run on them to
411 # produce a .dSYM bundle and a Breakpad .sym file. This is
412 # unnecessary for the "More Helpers" because they're identical
413 # to the original helper except for the bits in their Mach-O
414 # headers that change to enable or disable special features.
415 # Each .dSYM is identified by UUID stored in a Mach-O file's
416 # LC_UUID load command. Because the "More Helpers" share a UUID
417 # with the original helper, there's no need to run dsymutil
418 # again. All helpers can share the same .dSYM. Special handling
419 # is performed in chrome/tools/build/mac/dump_product_syms to
420 # prepare their Breakpad symbol files.
421 'postbuild_name': 'Make More Helpers',
423 '../build/mac/make_more_helpers.sh',
424 'Versions/<(version_full)',
425 '<(mac_product_name)',
429 # Make sure there isn't any Objective-C in the browser app's
431 'postbuild_name': 'Verify No Objective-C',
433 '../build/mac/verify_no_objc.sh',
440 # 'product_name': 'chromium'
441 # whenever we convert the rest of the infrastructure
442 # (buildbots etc.) to understand the branding gyp define.
443 # NOTE: chrome/app/theme/chromium/BRANDING and
444 # chrome/app/theme/google_chrome/BRANDING have the short name
445 # "chrome" etc.; should we try to extract from there instead?
447 # On Mac, this is done in chrome_dll.gypi.
450 '../pdf/pdf.gyp:pdf',
453 # CrOS does this in a separate build step.
454 ['OS=="linux" and chromeos==0 and linux_dump_symbols==1', {
456 '../pdf/pdf.gyp:pdf_linux_symbols',
458 }], # OS=="linux" and chromeos==0 and linux_dump_symbols==1
463 '../components/components.gyp:startup_metric_utils',
464 'chrome_resources.gyp:packed_extra_resources',
465 'chrome_resources.gyp:packed_resources',
466 # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp
467 # file decide what to do on a per-OS basis; on Mac, internal plugins
468 # go inside the framework, so this dependency is in chrome_dll.gypi.
469 '../third_party/adobe/flash/flash_player.gyp:flapper_binaries',
470 # Copy CDM files to PRODUCT_DIR if applicable. Let the .gyp
471 # file decide what to do on a per-OS basis; on Mac, internal plugins
472 # go inside the framework, so this dependency is in chrome_dll.gypi.
473 '../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
476 ['chrome_multiple_dll', {
477 'defines': ['CHROME_MULTIPLE_DLL'],
479 ['OS=="mac" and asan==1', {
481 # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
482 'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
487 ['branding=="Chrome"', {
489 'linux_installer_configs',
492 # For now, do not build nacl_helper when disable_nacl=1
493 # http://code.google.com/p/gyp/issues/detail?id=239
494 ['disable_nacl==0', {
496 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
497 '../components/nacl.gyp:nacl_helper',
502 '../sandbox/sandbox.gyp:sandbox',
509 'chrome_process_finder',
510 'chrome_version_resources',
513 '../base/base.gyp:base',
514 '../breakpad/breakpad.gyp:breakpad_handler',
515 '../breakpad/breakpad.gyp:breakpad_sender',
516 '../components/components.gyp:breakpad_component',
517 '../components/components.gyp:policy',
518 '../chrome_elf/chrome_elf.gyp:chrome_elf',
519 '../sandbox/sandbox.gyp:sandbox',
522 'app/chrome_breakpad_client.cc',
523 'app/chrome_breakpad_client.h',
525 'common/crash_keys.cc',
526 'common/crash_keys.h',
527 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
531 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
532 'OutputFile': '$(OutDir)\\initial\\chrome.exe',
540 'AdditionalDependencies': [ 'wintrust.lib' ],
541 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself.
545 'AdditionalManifestFiles': [
546 '$(ProjectDir)\\app\\chrome.exe.manifest',
547 '<(SHARED_INTERMEDIATE_DIR)/chrome/app/version_assembly/version_assembly.manifest',
553 'action_name': 'first_run',
558 '<(PRODUCT_DIR)/First Run',
560 'action': ['python', '../build/cp.py', '<@(_inputs)', '<@(_outputs)'],
561 'message': 'Copy first run complete sentinel file',
564 'action_name': 'chrome_exe_manifest',
566 'app/version_assembly/chrome_exe_manifest_action.gypi',
570 'action_name': 'version_assembly_manifest',
572 'app/version_assembly/version_assembly_manifest_action.gypi',
578 'app/client_util.cc',
581 ['OS=="win" and component=="shared_library"', {
582 'defines': ['COMPILE_CONTENT_STATICALLY'],
586 '../win8/metro_driver/metro_driver.gyp:metro_driver',
587 '../win8/delegate_execute/delegate_execute.gyp:*',
597 'target_name': 'image_pre_reader',
598 'type': 'static_library',
600 'app/image_pre_reader_win.cc',
601 'app/image_pre_reader_win.h',
604 '../base/base.gyp:base',
609 ['disable_nacl!=1 and target_arch=="ia32"', {
612 'target_name': 'chrome_nacl_win64',
613 'type': 'executable',
614 'product_name': 'nacl64',
616 'app/chrome_breakpad_client.cc',
617 'common/crash_keys.cc',
618 'nacl/nacl_exe_win_64.cc',
619 '../content/app/startup_helper_win.cc',
620 '../content/common/sandbox_init_win.cc',
621 '../content/common/sandbox_win.cc',
622 '../content/public/common/content_switches.cc',
623 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/nacl64_exe_version.rc',
626 'chrome_version_resources',
627 'installer_util_nacl_win64',
628 '../base/base.gyp:base_i18n_nacl_win64',
629 '../base/base.gyp:base_win64',
630 '../base/base.gyp:base_static_win64',
631 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
632 '../breakpad/breakpad.gyp:breakpad_handler_win64',
633 '../breakpad/breakpad.gyp:breakpad_sender_win64',
634 '../components/components.gyp:breakpad_win64',
635 '../chrome/common_constants.gyp:common_constants_win64',
636 '../components/components.gyp:policy_win64',
637 '../components/nacl.gyp:nacl_win64',
638 '../crypto/crypto.gyp:crypto_nacl_win64',
639 '../ipc/ipc.gyp:ipc_win64',
640 '../sandbox/sandbox.gyp:sandbox_win64',
643 '<@(nacl_win64_defines)',
644 'COMPILE_CONTENT_STATICALLY',
647 '<(SHARED_INTERMEDIATE_DIR)/chrome',
651 'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
652 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
657 'msvs_target_platform': 'x64',
662 }, { # else (disable_nacl==1)
665 'target_name': 'chrome_nacl_win64',
673 ['test_isolation_mode != "noop"', {
676 'target_name': 'chrome_run',
682 '../build/isolate.gypi',