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 # See comment in chrome_dll.gypi in the hardlink_to_output
18 # target for why this cannot be 'initial' like the DLL.
19 'exe_input_path':'$(OutDir)\\initialexe',
20 'exe_output_path':'<(PRODUCT_DIR)',
22 'action_name': 'reorder_imports',
25 '$(OutDir)\\initialexe\\chrome.exe',
28 '<(PRODUCT_DIR)\\chrome.exe',
29 '<(PRODUCT_DIR)\\chrome.exe.pdb',
34 '-i', '<(exe_input_path)',
35 '-o', '<(exe_output_path)',
36 '-a', '<(target_arch)',
38 'message': 'Reordering Imports',
45 'target_name': 'chrome_initial',
47 # Name the exe chrome.exe, not chrome_initial.exe.
48 'product_name': 'chrome',
51 'use_system_xdg_utils%': 0,
52 'enable_wexit_time_destructors': 1,
55 'app/chrome_exe_main_aura.cc',
56 'app/chrome_exe_main_mac.cc',
57 'app/chrome_exe_main_win.cc',
58 'app/chrome_exe_resource.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 ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
82 '../tools/cygprofile/cygprofile.gyp:cygprofile',
85 ['order_text_section!=""', {
86 'target_conditions' : [
87 ['_toolset=="target"', {
89 '-Wl,-section-ordering-file=<(order_text_section)' ],
95 # We still want the _win entry point for sandbox, etc.
96 'app/chrome_exe_main_aura.cc',
99 '../ui/gfx/gfx.gyp:gfx',
102 ['OS == "android"', {
103 # Don't put the 'chrome' target in 'all' on android
104 'suppress_wildcard': 1,
106 ['os_posix == 1 and OS != "mac" and OS != "android"', {
109 'action_name': 'manpage',
111 [ 'branding == "Chrome"', {
113 'name': 'Google Chrome',
114 'filename': 'google-chrome',
115 'confdir': 'google-chrome',
117 }, { # else branding!="Chrome"
120 'filename': 'chromium-browser',
121 'confdir': 'chromium',
126 'tools/build/linux/sed.sh',
127 'app/resources/manpage.1.in',
130 '<(PRODUCT_DIR)/chrome.1',
133 'tools/build/linux/sed.sh',
134 'app/resources/manpage.1.in',
136 '-e', 's/@@NAME@@/<(name)/',
137 '-e', 's/@@FILENAME@@/<(filename)/',
138 '-e', 's/@@CONFDIR@@/<(confdir)/',
140 'message': 'Generating manpage'
144 ['use_allocator!="none"', {
146 '<(allocator_target)',
150 ['profiling==0 and linux_disable_pie==0', {
155 ['use_system_xdg_utils==0', {
158 'destination': '<(PRODUCT_DIR)',
159 'files': ['tools/build/linux/chrome-wrapper',
160 '../third_party/xdg-utils/scripts/xdg-mime',
161 '../third_party/xdg-utils/scripts/xdg-settings',
163 # The wrapper script above may need to generate a .desktop
164 # file, which requires an icon. So, copy one next to the
167 ['branding=="Chrome"', {
168 'files': ['app/theme/google_chrome/product_logo_48.png']
169 }, { # else: 'branding!="Chrome"
170 'files': ['app/theme/chromium/product_logo_48.png']
176 # x11 build. Needed for chrome_main.cc initialization of libraries.
179 '../build/linux/system.gyp:x11',
180 '../build/linux/system.gyp:xext',
185 'app/chrome_dll_resource.h',
186 'app/chrome_main.cc',
187 'app/chrome_main_delegate.cc',
188 'app/chrome_main_delegate.h',
191 # On Linux, link the dependencies (libraries) that make up actual
192 # Chromium functionality directly into the executable.
193 '<@(chromium_browser_dependencies)',
194 '<@(chromium_child_dependencies)',
195 '../content/content.gyp:content_app_both',
196 # Needed for chrome_main.cc initialization of libraries.
197 '../build/linux/system.gyp:pangocairo',
198 # Needed to use the master_preferences functions
203 # 'branding' is a variable defined in common.gypi
204 # (e.g. "Chromium", "Chrome")
206 ['branding=="Chrome"', {
207 'mac_bundle_resources': [
208 'app/theme/google_chrome/mac/app.icns',
209 'app/theme/google_chrome/mac/document.icns',
210 'browser/ui/cocoa/applescript/scripting.sdef',
212 }, { # else: 'branding!="Chrome"
213 'mac_bundle_resources': [
214 'app/theme/chromium/mac/app.icns',
215 'app/theme/chromium/mac/document.icns',
216 'browser/ui/cocoa/applescript/scripting.sdef',
219 ['mac_breakpad==1', {
221 # A real .dSYM is needed for dump_syms to operate on.
225 # With mac_real_dsym set, strip_from_xcode won't be used.
226 # Specify CHROMIUM_STRIP_SAVE_FILE directly to Xcode.
227 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
230 '../breakpad/breakpad.gyp:dump_syms',
231 '../breakpad/breakpad.gyp:symupload',
233 # In order to process symbols for the Remoting Host plugin,
234 # that plugin needs to be built beforehand. Since the
235 # "Dump Symbols" step hangs off this target, that plugin also
236 # needs to be added as a dependency.
237 '../remoting/remoting.gyp:remoting_host_plugin',
239 # The "Dump Symbols" post-build step is in a target_conditions
240 # block so that it will follow the "Strip If Needed" step if that
241 # is also being used. There is no standard configuration where
242 # both of these steps occur together, but Mark likes to use this
243 # configuration sometimes when testing Breakpad-enabled builds
244 # without the time overhead of creating real .dSYM files. When
245 # both "Dump Symbols" and "Strip If Needed" are present, "Dump
246 # Symbols" must come second because "Strip If Needed" creates
247 # a fake .dSYM that dump_syms needs to fake dump. Since
248 # "Strip If Needed" is added in a target_conditions block in
249 # common.gypi, "Dump Symbols" needs to be in an (always true)
250 # target_conditions block.
251 'target_conditions': [
255 'postbuild_name': 'Dump Symbols',
257 'dump_product_syms_path':
258 'tools/build/mac/dump_product_syms',
260 'action': ['<(dump_product_syms_path)',
268 'product_name': '<(mac_product_name)',
270 # chrome/app/app-Info.plist has:
271 # CFBundleIdentifier of CHROMIUM_BUNDLE_ID
272 # CFBundleName of CHROMIUM_SHORT_NAME
273 # CFBundleSignature of CHROMIUM_CREATOR
274 # Xcode then replaces these values with the branded values we set
275 # as settings on the target.
276 'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
277 'CHROMIUM_CREATOR': '<(mac_creator)',
278 'CHROMIUM_SHORT_NAME': '<(branding)',
281 '../components/components.gyp:chrome_manifest_bundle',
283 'infoplist_strings_tool',
284 'interpose_dependency_shim',
285 # On Mac, make sure we've built chrome_dll, which contains all of
286 # the library code with Chromium functionality.
289 'mac_bundle_resources': [
290 '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
294 # Generate the InfoPlist.strings file
295 'action_name': 'Generate InfoPlist.strings files',
297 'tool_path': '<(PRODUCT_DIR)/infoplist_strings_tool',
298 # Unique dir to write to so the [lang].lproj/InfoPlist.strings
299 # for the main app and the helper app don't name collide.
300 'output_path': '<(INTERMEDIATE_DIR)/app_infoplist_strings',
303 [ 'branding == "Chrome"', {
305 'branding_name': 'google_chrome_strings',
307 }, { # else branding!="Chrome"
309 'branding_name': 'chromium_strings',
316 # TODO: remove this helper when we have loops in GYP
317 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
320 # TODO: remove this helper when we have loops in GYP
321 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
325 '-b', '<(branding_name)',
326 '-v', '<(version_path)',
327 '-g', '<(grit_out_dir)',
328 '-o', '<(output_path)',
332 'message': 'Generating the language InfoPlist.strings files',
333 'process_outputs_as_mac_bundle_resources': 1,
338 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
340 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
341 '<(PRODUCT_DIR)/libplugin_carbon_interpose.dylib',
347 'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
349 '../build/mac/copy_framework_unversioned.sh',
350 '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Framework.framework',
351 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Versions/<(version_full)',
355 # Modify the Info.plist as needed. The script explains why this
356 # is needed. This is also done in the helper_app and chrome_dll
357 # targets. Use --breakpad=0 to not include any Breakpad
358 # information; that all goes into the framework's Info.plist.
359 # Keystone information is included if Keystone is enabled. The
360 # application reads Keystone keys from this plist and not the
361 # framework's, and the ticket will reference this Info.plist to
362 # determine the tag of the installed product. Use --scm=1 to
363 # include SCM information. The --pdf flag controls whether
364 # to insert PDF as a supported type identifier that can be
366 'postbuild_name': 'Tweak Info.plist',
367 'action': ['<(tweak_info_plist_path)',
369 '--keystone=<(mac_keystone)',
372 '--bundle_id=<(mac_bundle_id)'],
375 'postbuild_name': 'Clean up old versions',
377 'tools/build/mac/clean_up_old_versions',
382 # This postbuid step is responsible for creating the following
385 # For unofficial Chromium branding, Chromium Helper EH.app and
386 # Chromium Helper NP.app are created from Chromium Helper.app.
387 # For official Google Chrome branding, Google Chrome Helper
388 # EH.app and Google Chrome Helper NP.app are created from
389 # Google Chrome Helper.app.
391 # The EH helper is marked for an executable heap. The NP helper
392 # is marked for no PIE (ASLR).
394 # Normally, applications shipping as part of offical builds with
395 # Google Chrome branding have dsymutil (dwarf-with-dsym,
396 # mac_real_dsym) and dump_syms (mac_breakpad) run on them to
397 # produce a .dSYM bundle and a Breakpad .sym file. This is
398 # unnecessary for the "More Helpers" because they're identical
399 # to the original helper except for the bits in their Mach-O
400 # headers that change to enable or disable special features.
401 # Each .dSYM is identified by UUID stored in a Mach-O file's
402 # LC_UUID load command. Because the "More Helpers" share a UUID
403 # with the original helper, there's no need to run dsymutil
404 # again. All helpers can share the same .dSYM. Special handling
405 # is performed in chrome/tools/build/mac/dump_product_syms to
406 # prepare their Breakpad symbol files.
407 'postbuild_name': 'Make More Helpers',
409 '../build/mac/make_more_helpers.sh',
410 'Versions/<(version_full)',
411 '<(mac_product_name)',
415 # Make sure there isn't any Objective-C in the browser app's
417 'postbuild_name': 'Verify No Objective-C',
419 '../build/mac/verify_no_objc.sh',
426 # 'product_name': 'chromium'
427 # whenever we convert the rest of the infrastructure
428 # (buildbots etc.) to understand the branding gyp define.
429 # NOTE: chrome/app/theme/chromium/BRANDING and
430 # chrome/app/theme/google_chrome/BRANDING have the short name
431 # "chrome" etc.; should we try to extract from there instead?
433 # CrOS does this in a separate build step.
434 ['OS=="linux" and chromeos==0 and linux_dump_symbols==1', {
436 '../pdf/pdf.gyp:pdf_linux_symbols',
438 }], # OS=="linux" and chromeos==0 and linux_dump_symbols==1
441 '../components/components.gyp:startup_metric_utils',
442 # On Mac, this is done in chrome_dll.gypi.
443 '../pdf/pdf.gyp:pdf',
444 'chrome_resources.gyp:packed_extra_resources',
445 'chrome_resources.gyp:packed_resources',
446 # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp
447 # file decide what to do on a per-OS basis; on Mac, internal plugins
448 # go inside the framework, so this dependency is in chrome_dll.gypi.
449 '../third_party/adobe/flash/flash_player.gyp:flapper_binaries',
450 # Copy CDM files to PRODUCT_DIR if applicable. Let the .gyp
451 # file decide what to do on a per-OS basis; on Mac, internal plugins
452 # go inside the framework, so this dependency is in chrome_dll.gypi.
453 '../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
456 ['chrome_multiple_dll', {
457 'defines': ['CHROME_MULTIPLE_DLL'],
459 ['OS=="mac" and asan==1', {
461 # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
462 'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
467 ['branding=="Chrome"', {
469 'linux_installer_configs',
472 # For now, do not build nacl_helper when disable_nacl=1
473 # http://code.google.com/p/gyp/issues/detail?id=239
474 ['disable_nacl==0', {
476 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
477 '../components/nacl.gyp:nacl_helper',
482 '../sandbox/sandbox.gyp:sandbox',
489 'chrome_process_finder',
490 'chrome_version_resources',
493 '../base/base.gyp:base',
494 '../breakpad/breakpad.gyp:breakpad_handler',
495 '../breakpad/breakpad.gyp:breakpad_sender',
496 '../chrome_elf/chrome_elf.gyp:chrome_elf',
497 '../components/components.gyp:breakpad_component',
498 '../sandbox/sandbox.gyp:sandbox',
501 'app/chrome_breakpad_client.cc',
502 'app/chrome_breakpad_client.h',
504 'common/crash_keys.cc',
505 'common/crash_keys.h',
506 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
510 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
511 'OutputFile': '$(OutDir)\\initialexe\\chrome.exe',
519 'AdditionalDependencies': [ 'wintrust.lib' ],
520 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself.
524 'AdditionalManifestFiles': [
525 '$(ProjectDir)\\app\\chrome.exe.manifest',
526 '<(SHARED_INTERMEDIATE_DIR)/chrome/app/version_assembly/version_assembly.manifest',
531 ['configuration_policy==1', {
533 '<(DEPTH)/components/components.gyp:policy',
539 'action_name': 'first_run',
544 '<(PRODUCT_DIR)/First Run',
546 'action': ['python', '../build/cp.py', '<@(_inputs)', '<@(_outputs)'],
547 'message': 'Copy first run complete sentinel file',
550 'action_name': 'chrome_exe_manifest',
552 'app/version_assembly/chrome_exe_manifest_action.gypi',
556 'action_name': 'version_assembly_manifest',
558 'app/version_assembly/version_assembly_manifest_action.gypi',
564 'app/client_util.cc',
567 ['OS=="win" and target_arch=="ia32"', {
569 # TODO(scottmg): This is a workaround for
570 # http://crbug.com/348525 that affects VS2013 before Update 2.
571 # This should be removed once Update 2 is released.
572 '../build/win/ftol3.obj',
575 ['OS=="win" and component=="shared_library"', {
576 'defines': ['COMPILE_CONTENT_STATICALLY'],
580 '../win8/metro_driver/metro_driver.gyp:metro_driver',
581 '../win8/delegate_execute/delegate_execute.gyp:*',
591 'target_name': 'image_pre_reader',
592 'type': 'static_library',
594 'app/image_pre_reader_win.cc',
595 'app/image_pre_reader_win.h',
598 '../base/base.gyp:base',
603 ['disable_nacl!=1 and target_arch=="ia32"', {
606 'target_name': 'chrome_nacl_win64',
607 'type': 'executable',
608 'product_name': 'nacl64',
610 'app/chrome_breakpad_client.cc',
611 'common/crash_keys.cc',
612 'nacl/nacl_exe_win_64.cc',
613 '../content/app/startup_helper_win.cc',
614 '../content/common/sandbox_init_win.cc',
615 '../content/common/sandbox_win.cc',
616 '../content/public/common/content_switches.cc',
617 '../content/public/common/sandboxed_process_launcher_delegate.cc',
618 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/nacl64_exe_version.rc',
621 'chrome_version_resources',
622 'installer_util_nacl_win64',
623 '../base/base.gyp:base_i18n_nacl_win64',
624 '../base/base.gyp:base_win64',
625 '../base/base.gyp:base_static_win64',
626 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
627 '../breakpad/breakpad.gyp:breakpad_handler_win64',
628 '../breakpad/breakpad.gyp:breakpad_sender_win64',
629 '../components/components.gyp:breakpad_win64',
630 '../chrome/common_constants.gyp:common_constants_win64',
631 '../components/nacl.gyp:nacl_win64',
632 '../crypto/crypto.gyp:crypto_nacl_win64',
633 '../ipc/ipc.gyp:ipc_win64',
634 '../sandbox/sandbox.gyp:sandbox_win64',
637 '<@(nacl_win64_defines)',
638 'COMPILE_CONTENT_STATICALLY',
641 '<(SHARED_INTERMEDIATE_DIR)/chrome',
645 'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
646 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
651 'msvs_target_platform': 'x64',
655 ['configuration_policy==1', {
657 '<(DEPTH)/components/components.gyp:policy_win64',
663 }, { # else (disable_nacl==1)
666 'target_name': 'chrome_nacl_win64',
674 ['test_isolation_mode != "noop"', {
677 'target_name': 'chrome_run',
683 '../build/isolate.gypi',