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_gtk.cc',
57 'app/chrome_exe_main_mac.cc',
58 'app/chrome_exe_main_win.cc',
59 'app/chrome_exe_resource.h',
62 'app/metro_driver_win.cc',
63 'app/metro_driver_win.h',
64 'app/signature_validator_win.cc',
65 'app/signature_validator_win.h',
66 '<(DEPTH)/content/app/startup_helper_win.cc',
67 '<(DEPTH)/content/public/common/content_switches.cc',
69 'mac_bundle_resources': [
72 # TODO(mark): Come up with a fancier way to do this. It should only
73 # be necessary to list app-Info.plist once, not the three times it is
75 'mac_bundle_resources!': [
79 'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves',
80 'INFOPLIST_FILE': 'app/app-Info.plist',
83 ['component == "shared_library"', {
85 'win_use_external_manifest': 1,
88 ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
90 '../tools/cygprofile/cygprofile.gyp:cygprofile',
93 ['order_text_section!=""', {
94 'target_conditions' : [
95 ['_toolset=="target"', {
97 '-Wl,-section-ordering-file=<(order_text_section)' ],
101 ['OS == "win" and use_aura==1', {
103 # We still want the _win entry point for sandbox, etc.
104 'app/chrome_exe_main_aura.cc',
107 '../ui/gfx/gfx.gyp:gfx',
110 ['OS == "android"', {
111 # Don't put the 'chrome' target in 'all' on android
112 'suppress_wildcard': 1,
114 ['os_posix == 1 and OS != "mac" and OS != "android"', {
117 'action_name': 'manpage',
119 [ 'branding == "Chrome"', {
121 'name': 'Google Chrome',
122 'filename': 'google-chrome',
123 'confdir': 'google-chrome',
125 }, { # else branding!="Chrome"
128 'filename': 'chromium-browser',
129 'confdir': 'chromium',
134 'tools/build/linux/sed.sh',
135 'app/resources/manpage.1.in',
138 '<(PRODUCT_DIR)/chrome.1',
141 'tools/build/linux/sed.sh',
142 'app/resources/manpage.1.in',
144 '-e', 's/@@NAME@@/<(name)/',
145 '-e', 's/@@FILENAME@@/<(filename)/',
146 '-e', 's/@@CONFDIR@@/<(confdir)/',
148 'message': 'Generating manpage'
152 ['linux_use_tcmalloc==1', {
154 '<(allocator_target)',
158 ['profiling==0 and linux_disable_pie==0', {
163 ['use_system_xdg_utils==0', {
166 'destination': '<(PRODUCT_DIR)',
167 'files': ['tools/build/linux/chrome-wrapper',
168 '../third_party/xdg-utils/scripts/xdg-mime',
169 '../third_party/xdg-utils/scripts/xdg-settings',
171 # The wrapper script above may need to generate a .desktop
172 # file, which requires an icon. So, copy one next to the
175 ['branding=="Chrome"', {
176 'files': ['app/theme/google_chrome/product_logo_48.png']
177 }, { # else: 'branding!="Chrome"
178 'files': ['app/theme/chromium/product_logo_48.png']
184 ['toolkit_uses_gtk == 1', {
186 # On Linux, link the dependencies (libraries) that make up actual
187 # Chromium functionality directly into the executable.
188 '<@(chromium_browser_dependencies)',
189 '<@(chromium_child_dependencies)',
190 '../content/content.gyp:content_app_both',
191 # Needed for chrome_main.cc initialization of libraries.
192 '../build/linux/system.gyp:gtk',
193 # Needed to use the master_preferences functions
196 }, { # else toolkit_uses_gtk == 1
198 # On Linux, link the dependencies (libraries) that make up actual
199 # Chromium functionality directly into the executable.
200 '<@(chromium_browser_dependencies)',
201 '<@(chromium_child_dependencies)',
202 '../content/content.gyp:content_app_both',
203 # Needed for chrome_main.cc initialization of libraries.
204 '../build/linux/system.gyp:x11',
205 '../build/linux/system.gyp:pangocairo',
206 '../build/linux/system.gyp:xext',
207 # Needed to use the master_preferences functions
213 'app/chrome_dll_resource.h',
214 'app/chrome_main.cc',
215 'app/chrome_main_delegate.cc',
216 'app/chrome_main_delegate.h',
220 # 'branding' is a variable defined in common.gypi
221 # (e.g. "Chromium", "Chrome")
223 ['branding=="Chrome"', {
224 'mac_bundle_resources': [
225 'app/theme/google_chrome/mac/app.icns',
226 'app/theme/google_chrome/mac/document.icns',
227 'browser/ui/cocoa/applescript/scripting.sdef',
229 }, { # else: 'branding!="Chrome"
230 'mac_bundle_resources': [
231 'app/theme/chromium/mac/app.icns',
232 'app/theme/chromium/mac/document.icns',
233 'browser/ui/cocoa/applescript/scripting.sdef',
236 ['mac_breakpad==1', {
238 # A real .dSYM is needed for dump_syms to operate on.
242 # With mac_real_dsym set, strip_from_xcode won't be used.
243 # Specify CHROMIUM_STRIP_SAVE_FILE directly to Xcode.
244 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
247 '../breakpad/breakpad.gyp:dump_syms',
248 '../breakpad/breakpad.gyp:symupload',
250 # In order to process symbols for the Remoting Host plugin,
251 # that plugin needs to be built beforehand. Since the
252 # "Dump Symbols" step hangs off this target, that plugin also
253 # needs to be added as a dependency.
254 '../remoting/remoting.gyp:remoting_host_plugin',
256 # The "Dump Symbols" post-build step is in a target_conditions
257 # block so that it will follow the "Strip If Needed" step if that
258 # is also being used. There is no standard configuration where
259 # both of these steps occur together, but Mark likes to use this
260 # configuration sometimes when testing Breakpad-enabled builds
261 # without the time overhead of creating real .dSYM files. When
262 # both "Dump Symbols" and "Strip If Needed" are present, "Dump
263 # Symbols" must come second because "Strip If Needed" creates
264 # a fake .dSYM that dump_syms needs to fake dump. Since
265 # "Strip If Needed" is added in a target_conditions block in
266 # common.gypi, "Dump Symbols" needs to be in an (always true)
267 # target_conditions block.
268 'target_conditions': [
272 'postbuild_name': 'Dump Symbols',
274 'dump_product_syms_path':
275 'tools/build/mac/dump_product_syms',
277 'action': ['<(dump_product_syms_path)',
285 'product_name': '<(mac_product_name)',
287 # chrome/app/app-Info.plist has:
288 # CFBundleIdentifier of CHROMIUM_BUNDLE_ID
289 # CFBundleName of CHROMIUM_SHORT_NAME
290 # CFBundleSignature of CHROMIUM_CREATOR
291 # Xcode then replaces these values with the branded values we set
292 # as settings on the target.
293 'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
294 'CHROMIUM_CREATOR': '<(mac_creator)',
295 'CHROMIUM_SHORT_NAME': '<(branding)',
298 '../components/components.gyp:chrome_manifest_bundle',
300 'infoplist_strings_tool',
301 'interpose_dependency_shim',
302 # On Mac, make sure we've built chrome_dll, which contains all of
303 # the library code with Chromium functionality.
306 'mac_bundle_resources': [
307 '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
311 # Generate the InfoPlist.strings file
312 'action_name': 'Generate InfoPlist.strings files',
314 'tool_path': '<(PRODUCT_DIR)/infoplist_strings_tool',
315 # Unique dir to write to so the [lang].lproj/InfoPlist.strings
316 # for the main app and the helper app don't name collide.
317 'output_path': '<(INTERMEDIATE_DIR)/app_infoplist_strings',
320 [ 'branding == "Chrome"', {
322 'branding_name': 'google_chrome_strings',
324 }, { # else branding!="Chrome"
326 'branding_name': 'chromium_strings',
333 # TODO: remove this helper when we have loops in GYP
334 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
337 # TODO: remove this helper when we have loops in GYP
338 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
342 '-b', '<(branding_name)',
343 '-v', '<(version_path)',
344 '-g', '<(grit_out_dir)',
345 '-o', '<(output_path)',
349 'message': 'Generating the language InfoPlist.strings files',
350 'process_outputs_as_mac_bundle_resources': 1,
355 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
357 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
358 '<(PRODUCT_DIR)/libplugin_carbon_interpose.dylib',
364 'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
366 '../build/mac/copy_framework_unversioned.sh',
367 '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Framework.framework',
368 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Versions/<(version_full)',
372 # Modify the Info.plist as needed. The script explains why this
373 # is needed. This is also done in the helper_app and chrome_dll
374 # targets. Use --breakpad=0 to not include any Breakpad
375 # information; that all goes into the framework's Info.plist.
376 # Keystone information is included if Keystone is enabled. The
377 # application reads Keystone keys from this plist and not the
378 # framework's, and the ticket will reference this Info.plist to
379 # determine the tag of the installed product. Use --scm=1 to
380 # include SCM information. The --pdf flag controls whether
381 # to insert PDF as a supported type identifier that can be
383 'postbuild_name': 'Tweak Info.plist',
384 'action': ['<(tweak_info_plist_path)',
386 '--keystone=<(mac_keystone)',
388 '--pdf=<(internal_pdf)',
389 '--bundle_id=<(mac_bundle_id)'],
392 'postbuild_name': 'Clean up old versions',
394 'tools/build/mac/clean_up_old_versions',
399 # This postbuid step is responsible for creating the following
402 # For unofficial Chromium branding, Chromium Helper EH.app and
403 # Chromium Helper NP.app are created from Chromium Helper.app.
404 # For official Google Chrome branding, Google Chrome Helper
405 # EH.app and Google Chrome Helper NP.app are created from
406 # Google Chrome Helper.app.
408 # The EH helper is marked for an executable heap. The NP helper
409 # is marked for no PIE (ASLR).
411 # Normally, applications shipping as part of offical builds with
412 # Google Chrome branding have dsymutil (dwarf-with-dsym,
413 # mac_real_dsym) and dump_syms (mac_breakpad) run on them to
414 # produce a .dSYM bundle and a Breakpad .sym file. This is
415 # unnecessary for the "More Helpers" because they're identical
416 # to the original helper except for the bits in their Mach-O
417 # headers that change to enable or disable special features.
418 # Each .dSYM is identified by UUID stored in a Mach-O file's
419 # LC_UUID load command. Because the "More Helpers" share a UUID
420 # with the original helper, there's no need to run dsymutil
421 # again. All helpers can share the same .dSYM. Special handling
422 # is performed in chrome/tools/build/mac/dump_product_syms to
423 # prepare their Breakpad symbol files.
424 'postbuild_name': 'Make More Helpers',
426 '../build/mac/make_more_helpers.sh',
427 'Versions/<(version_full)',
428 '<(mac_product_name)',
432 # Make sure there isn't any Objective-C in the browser app's
434 'postbuild_name': 'Verify No Objective-C',
436 '../build/mac/verify_no_objc.sh',
443 # 'product_name': 'chromium'
444 # whenever we convert the rest of the infrastructure
445 # (buildbots etc.) to understand the branding gyp define.
446 # NOTE: chrome/app/theme/chromium/BRANDING and
447 # chrome/app/theme/google_chrome/BRANDING have the short name
448 # "chrome" etc.; should we try to extract from there instead?
450 # On Mac, this is done in chrome_dll.gypi.
453 '../pdf/pdf.gyp:pdf',
456 # CrOS does this in a separate build step.
457 ['OS=="linux" and chromeos==0 and linux_dump_symbols==1', {
459 '../pdf/pdf.gyp:pdf_linux_symbols',
461 }], # OS=="linux" and chromeos==0 and linux_dump_symbols==1
466 '../components/components.gyp:startup_metric_utils',
467 'chrome_resources.gyp:packed_extra_resources',
468 'chrome_resources.gyp:packed_resources',
469 # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp
470 # file decide what to do on a per-OS basis; on Mac, internal plugins
471 # go inside the framework, so this dependency is in chrome_dll.gypi.
472 '../third_party/adobe/flash/flash_player.gyp:flapper_binaries',
473 # Copy CDM files to PRODUCT_DIR if applicable. Let the .gyp
474 # file decide what to do on a per-OS basis; on Mac, internal plugins
475 # go inside the framework, so this dependency is in chrome_dll.gypi.
476 '../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
479 ['chrome_multiple_dll', {
480 'defines': ['CHROME_MULTIPLE_DLL'],
482 ['OS=="mac" and asan==1', {
484 # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
485 'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
490 ['branding=="Chrome"', {
492 'linux_installer_configs',
495 # For now, do not build nacl_helper when disable_nacl=1
496 # http://code.google.com/p/gyp/issues/detail?id=239
497 ['disable_nacl==0', {
499 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
500 '../components/nacl.gyp:nacl_helper',
505 '../sandbox/sandbox.gyp:sandbox',
512 'chrome_process_finder',
513 'chrome_version_resources',
516 '../base/base.gyp:base',
517 '../breakpad/breakpad.gyp:breakpad_handler',
518 '../breakpad/breakpad.gyp:breakpad_sender',
519 '../chrome_elf/chrome_elf.gyp:chrome_elf',
520 '../components/components.gyp:breakpad_component',
521 '../components/components.gyp:policy',
522 '../sandbox/sandbox.gyp:sandbox',
525 'app/chrome_breakpad_client.cc',
526 'app/chrome_breakpad_client.h',
528 'common/crash_keys.cc',
529 'common/crash_keys.h',
530 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
534 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
535 'OutputFile': '$(OutDir)\\initialexe\\chrome.exe',
543 'AdditionalDependencies': [ 'wintrust.lib' ],
544 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself.
548 'AdditionalManifestFiles': [
549 '$(ProjectDir)\\app\\chrome.exe.manifest',
550 '<(SHARED_INTERMEDIATE_DIR)/chrome/app/version_assembly/version_assembly.manifest',
556 'action_name': 'first_run',
561 '<(PRODUCT_DIR)/First Run',
563 'action': ['python', '../build/cp.py', '<@(_inputs)', '<@(_outputs)'],
564 'message': 'Copy first run complete sentinel file',
567 'action_name': 'chrome_exe_manifest',
569 'app/version_assembly/chrome_exe_manifest_action.gypi',
573 'action_name': 'version_assembly_manifest',
575 'app/version_assembly/version_assembly_manifest_action.gypi',
581 'app/client_util.cc',
584 ['OS=="win" and component=="shared_library"', {
585 'defines': ['COMPILE_CONTENT_STATICALLY'],
589 '../win8/metro_driver/metro_driver.gyp:metro_driver',
590 '../win8/delegate_execute/delegate_execute.gyp:*',
600 'target_name': 'image_pre_reader',
601 'type': 'static_library',
603 'app/image_pre_reader_win.cc',
604 'app/image_pre_reader_win.h',
607 '../base/base.gyp:base',
612 ['disable_nacl!=1 and target_arch=="ia32"', {
615 'target_name': 'chrome_nacl_win64',
616 'type': 'executable',
617 'product_name': 'nacl64',
619 'app/chrome_breakpad_client.cc',
620 'common/crash_keys.cc',
621 'nacl/nacl_exe_win_64.cc',
622 '../content/app/startup_helper_win.cc',
623 '../content/common/sandbox_init_win.cc',
624 '../content/common/sandbox_win.cc',
625 '../content/public/common/content_switches.cc',
626 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/nacl64_exe_version.rc',
629 'chrome_version_resources',
630 'installer_util_nacl_win64',
631 '../base/base.gyp:base_i18n_nacl_win64',
632 '../base/base.gyp:base_win64',
633 '../base/base.gyp:base_static_win64',
634 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
635 '../breakpad/breakpad.gyp:breakpad_handler_win64',
636 '../breakpad/breakpad.gyp:breakpad_sender_win64',
637 '../components/components.gyp:breakpad_win64',
638 '../chrome/common_constants.gyp:common_constants_win64',
639 '../components/components.gyp:policy_win64',
640 '../components/nacl.gyp:nacl_win64',
641 '../crypto/crypto.gyp:crypto_nacl_win64',
642 '../ipc/ipc.gyp:ipc_win64',
643 '../sandbox/sandbox.gyp:sandbox_win64',
646 '<@(nacl_win64_defines)',
647 'COMPILE_CONTENT_STATICALLY',
650 '<(SHARED_INTERMEDIATE_DIR)/chrome',
654 'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
655 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
660 'msvs_target_platform': 'x64',
665 }, { # else (disable_nacl==1)
668 'target_name': 'chrome_nacl_win64',
676 ['test_isolation_mode != "noop"', {
679 'target_name': 'chrome_run',
685 '../build/isolate.gypi',