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)',
34 'message': 'Reordering Imports',
41 'target_name': 'chrome_initial',
43 # Name the exe chrome.exe, not chrome_initial.exe.
44 'product_name': 'chrome',
47 'use_system_xdg_utils%': 0,
48 'enable_wexit_time_destructors': 1,
51 'app/chrome_exe_main_aura.cc',
52 'app/chrome_exe_main_gtk.cc',
53 'app/chrome_exe_main_mac.cc',
54 'app/chrome_exe_main_win.cc',
55 'app/chrome_exe_resource.h',
58 'app/metro_driver_win.cc',
59 'app/metro_driver_win.h',
60 'app/signature_validator_win.cc',
61 'app/signature_validator_win.h',
62 '<(DEPTH)/content/app/startup_helper_win.cc',
63 '<(DEPTH)/content/public/common/content_switches.cc',
65 'mac_bundle_resources': [
68 # TODO(mark): Come up with a fancier way to do this. It should only
69 # be necessary to list app-Info.plist once, not the three times it is
71 'mac_bundle_resources!': [
75 'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves',
76 'INFOPLIST_FILE': 'app/app-Info.plist',
79 ['component == "shared_library"', {
81 'win_use_external_manifest': 1,
84 ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
86 '../tools/cygprofile/cygprofile.gyp:cygprofile',
89 ['order_text_section!=""', {
90 'target_conditions' : [
91 ['_toolset=="target"', {
93 '-Wl,-section-ordering-file=<(order_text_section)' ],
97 ['OS == "win" and use_aura==1', {
99 # We still want the _win entry point for sandbox, etc.
100 'app/chrome_exe_main_aura.cc',
103 '../ui/gfx/gfx.gyp:gfx',
106 ['OS == "android"', {
107 # Don't put the 'chrome' target in 'all' on android
108 'suppress_wildcard': 1,
110 ['os_posix == 1 and OS != "mac" and OS != "android"', {
113 'action_name': 'manpage',
115 [ 'branding == "Chrome"', {
117 'name': 'Google Chrome',
118 'filename': 'google-chrome',
119 'confdir': 'google-chrome',
121 }, { # else branding!="Chrome"
124 'filename': 'chromium-browser',
125 'confdir': 'chromium',
130 'tools/build/linux/sed.sh',
131 'app/resources/manpage.1.in',
134 '<(PRODUCT_DIR)/chrome.1',
137 'tools/build/linux/sed.sh',
138 'app/resources/manpage.1.in',
140 '-e', 's/@@NAME@@/<(name)/',
141 '-e', 's/@@FILENAME@@/<(filename)/',
142 '-e', 's/@@CONFDIR@@/<(confdir)/',
144 'message': 'Generating manpage'
148 ['linux_use_tcmalloc==1', {
150 '<(allocator_target)',
154 ['profiling==0 and linux_disable_pie==0', {
159 ['use_system_xdg_utils==0', {
162 'destination': '<(PRODUCT_DIR)',
163 'files': ['tools/build/linux/chrome-wrapper',
164 '../third_party/xdg-utils/scripts/xdg-mime',
165 '../third_party/xdg-utils/scripts/xdg-settings',
167 # The wrapper script above may need to generate a .desktop
168 # file, which requires an icon. So, copy one next to the
171 ['branding=="Chrome"', {
172 'files': ['app/theme/google_chrome/product_logo_48.png']
173 }, { # else: 'branding!="Chrome"
174 'files': ['app/theme/chromium/product_logo_48.png']
180 ['toolkit_uses_gtk == 1', {
182 # On Linux, link the dependencies (libraries) that make up actual
183 # Chromium functionality directly into the executable.
184 '<@(chromium_browser_dependencies)',
185 '<@(chromium_child_dependencies)',
186 '../content/content.gyp:content_app_both',
187 # Needed for chrome_main.cc initialization of libraries.
188 '../build/linux/system.gyp:gtk',
189 # Needed to use the master_preferences functions
192 }, { # else toolkit_uses_gtk == 1
194 # On Linux, link the dependencies (libraries) that make up actual
195 # Chromium functionality directly into the executable.
196 '<@(chromium_browser_dependencies)',
197 '<@(chromium_child_dependencies)',
198 '../content/content.gyp:content_app_both',
199 # Needed for chrome_main.cc initialization of libraries.
200 '../build/linux/system.gyp:x11',
201 '../build/linux/system.gyp:pangocairo',
202 '../build/linux/system.gyp:xext',
203 # Needed to use the master_preferences functions
209 'app/chrome_dll_resource.h',
210 'app/chrome_main.cc',
211 'app/chrome_main_delegate.cc',
212 'app/chrome_main_delegate.h',
216 # 'branding' is a variable defined in common.gypi
217 # (e.g. "Chromium", "Chrome")
219 ['branding=="Chrome"', {
220 'mac_bundle_resources': [
221 'app/theme/google_chrome/app.icns',
222 'app/theme/google_chrome/document.icns',
223 'browser/ui/cocoa/applescript/scripting.sdef',
225 }, { # else: 'branding!="Chrome"
226 'mac_bundle_resources': [
227 'app/theme/chromium/mac/app.icns',
228 'app/theme/chromium/mac/document.icns',
229 'browser/ui/cocoa/applescript/scripting.sdef',
232 ['mac_breakpad==1', {
234 # A real .dSYM is needed for dump_syms to operate on.
238 # With mac_real_dsym set, strip_from_xcode won't be used.
239 # Specify CHROMIUM_STRIP_SAVE_FILE directly to Xcode.
240 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
243 '../breakpad/breakpad.gyp:dump_syms',
244 '../breakpad/breakpad.gyp:symupload',
246 # In order to process symbols for the Remoting Host plugin,
247 # that plugin needs to be built beforehand. Since the
248 # "Dump Symbols" step hangs off this target, that plugin also
249 # needs to be added as a dependency.
250 '../remoting/remoting.gyp:remoting_host_plugin',
252 # The "Dump Symbols" post-build step is in a target_conditions
253 # block so that it will follow the "Strip If Needed" step if that
254 # is also being used. There is no standard configuration where
255 # both of these steps occur together, but Mark likes to use this
256 # configuration sometimes when testing Breakpad-enabled builds
257 # without the time overhead of creating real .dSYM files. When
258 # both "Dump Symbols" and "Strip If Needed" are present, "Dump
259 # Symbols" must come second because "Strip If Needed" creates
260 # a fake .dSYM that dump_syms needs to fake dump. Since
261 # "Strip If Needed" is added in a target_conditions block in
262 # common.gypi, "Dump Symbols" needs to be in an (always true)
263 # target_conditions block.
264 'target_conditions': [
268 'postbuild_name': 'Dump Symbols',
270 'dump_product_syms_path':
271 'tools/build/mac/dump_product_syms',
273 'action': ['<(dump_product_syms_path)',
281 'product_name': '<(mac_product_name)',
283 # chrome/app/app-Info.plist has:
284 # CFBundleIdentifier of CHROMIUM_BUNDLE_ID
285 # CFBundleName of CHROMIUM_SHORT_NAME
286 # CFBundleSignature of CHROMIUM_CREATOR
287 # Xcode then replaces these values with the branded values we set
288 # as settings on the target.
289 'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
290 'CHROMIUM_CREATOR': '<(mac_creator)',
291 'CHROMIUM_SHORT_NAME': '<(branding)',
294 '../components/components.gyp:chrome_manifest_bundle',
296 'infoplist_strings_tool',
297 'interpose_dependency_shim',
298 # On Mac, make sure we've built chrome_dll, which contains all of
299 # the library code with Chromium functionality.
302 'mac_bundle_resources': [
303 '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
307 # Generate the InfoPlist.strings file
308 'action_name': 'Generate InfoPlist.strings files',
310 'tool_path': '<(PRODUCT_DIR)/infoplist_strings_tool',
311 # Unique dir to write to so the [lang].lproj/InfoPlist.strings
312 # for the main app and the helper app don't name collide.
313 'output_path': '<(INTERMEDIATE_DIR)/app_infoplist_strings',
316 [ 'branding == "Chrome"', {
318 'branding_name': 'google_chrome_strings',
320 }, { # else branding!="Chrome"
322 'branding_name': 'chromium_strings',
329 # TODO: remove this helper when we have loops in GYP
330 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
333 # TODO: remove this helper when we have loops in GYP
334 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
338 '-b', '<(branding_name)',
339 '-v', '<(version_path)',
340 '-g', '<(grit_out_dir)',
341 '-o', '<(output_path)',
345 'message': 'Generating the language InfoPlist.strings files',
346 'process_outputs_as_mac_bundle_resources': 1,
351 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
353 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
354 '<(PRODUCT_DIR)/libplugin_carbon_interpose.dylib',
360 'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
362 '../build/mac/copy_framework_unversioned.sh',
363 '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Framework.framework',
364 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Versions/<(version_full)',
368 # Modify the Info.plist as needed. The script explains why this
369 # is needed. This is also done in the helper_app and chrome_dll
370 # targets. Use --breakpad=0 to not include any Breakpad
371 # information; that all goes into the framework's Info.plist.
372 # Keystone information is included if Keystone is enabled. The
373 # application reads Keystone keys from this plist and not the
374 # framework's, and the ticket will reference this Info.plist to
375 # determine the tag of the installed product. Use --scm=1 to
376 # include SCM information. The --pdf flag controls whether
377 # to insert PDF as a supported type identifier that can be
379 'postbuild_name': 'Tweak Info.plist',
380 'action': ['<(tweak_info_plist_path)',
382 '--keystone=<(mac_keystone)',
384 '--pdf=<(internal_pdf)',
385 '--bundle_id=<(mac_bundle_id)'],
388 'postbuild_name': 'Clean up old versions',
390 'tools/build/mac/clean_up_old_versions',
395 # This postbuid step is responsible for creating the following
398 # For unofficial Chromium branding, Chromium Helper EH.app and
399 # Chromium Helper NP.app are created from Chromium Helper.app.
400 # For official Google Chrome branding, Google Chrome Helper
401 # EH.app and Google Chrome Helper NP.app are created from
402 # Google Chrome Helper.app.
404 # The EH helper is marked for an executable heap. The NP helper
405 # is marked for no PIE (ASLR).
407 # Normally, applications shipping as part of offical builds with
408 # Google Chrome branding have dsymutil (dwarf-with-dsym,
409 # mac_real_dsym) and dump_syms (mac_breakpad) run on them to
410 # produce a .dSYM bundle and a Breakpad .sym file. This is
411 # unnecessary for the "More Helpers" because they're identical
412 # to the original helper except for the bits in their Mach-O
413 # headers that change to enable or disable special features.
414 # Each .dSYM is identified by UUID stored in a Mach-O file's
415 # LC_UUID load command. Because the "More Helpers" share a UUID
416 # with the original helper, there's no need to run dsymutil
417 # again. All helpers can share the same .dSYM. Special handling
418 # is performed in chrome/tools/build/mac/dump_product_syms to
419 # prepare their Breakpad symbol files.
420 'postbuild_name': 'Make More Helpers',
422 '../build/mac/make_more_helpers.sh',
423 'Versions/<(version_full)',
424 '<(mac_product_name)',
428 # Make sure there isn't any Objective-C in the browser app's
430 'postbuild_name': 'Verify No Objective-C',
432 '../build/mac/verify_no_objc.sh',
439 # 'product_name': 'chromium'
440 # whenever we convert the rest of the infrastructure
441 # (buildbots etc.) to understand the branding gyp define.
442 # NOTE: chrome/app/theme/chromium/BRANDING and
443 # chrome/app/theme/google_chrome/BRANDING have the short name
444 # "chrome" etc.; should we try to extract from there instead?
446 # On Mac, this is done in chrome_dll.gypi.
449 '../pdf/pdf.gyp:pdf',
452 # CrOS does this in a separate build step.
453 ['OS=="linux" and chromeos==0 and linux_dump_symbols==1', {
455 '../pdf/pdf.gyp:pdf_linux_symbols',
457 }], # OS=="linux" and chromeos==0 and linux_dump_symbols==1
462 '../components/components.gyp:startup_metric_utils',
463 'chrome_resources.gyp:packed_extra_resources',
464 'chrome_resources.gyp:packed_resources',
465 # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp
466 # file decide what to do on a per-OS basis; on Mac, internal plugins
467 # go inside the framework, so this dependency is in chrome_dll.gypi.
468 '../third_party/adobe/flash/flash_player.gyp:flapper_binaries',
469 # Copy CDM 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/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
475 ['chrome_multiple_dll', {
476 'defines': ['CHROME_MULTIPLE_DLL'],
478 ['OS=="mac" and asan==1', {
480 # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
481 'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
486 ['branding=="Chrome"', {
488 'linux_installer_configs',
491 # For now, do not build nacl_helper when disable_nacl=1
492 # http://code.google.com/p/gyp/issues/detail?id=239
493 ['disable_nacl==0', {
495 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
496 '../components/nacl.gyp:nacl_helper',
501 '../sandbox/sandbox.gyp:sandbox',
508 'chrome_process_finder',
509 'chrome_version_resources',
512 '../base/base.gyp:base',
513 '../breakpad/breakpad.gyp:breakpad_handler',
514 '../breakpad/breakpad.gyp:breakpad_sender',
515 '../components/components.gyp:breakpad_component',
516 '../components/components.gyp:policy',
517 '../chrome_elf/chrome_elf.gyp:chrome_elf',
518 '../sandbox/sandbox.gyp:sandbox',
521 'app/chrome_breakpad_client.cc',
522 'app/chrome_breakpad_client.h',
524 'common/crash_keys.cc',
525 'common/crash_keys.h',
526 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
530 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
531 'OutputFile': '$(OutDir)\\initial\\chrome.exe',
539 'AdditionalDependencies': [ 'wintrust.lib' ],
540 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself.
544 'AdditionalManifestFiles': [
545 '$(ProjectDir)\\app\\chrome.exe.manifest',
546 '<(SHARED_INTERMEDIATE_DIR)/chrome/app/version_assembly/version_assembly.manifest',
552 'action_name': 'first_run',
557 '<(PRODUCT_DIR)/First Run',
559 'action': ['python', '../build/cp.py', '<@(_inputs)', '<@(_outputs)'],
560 'message': 'Copy first run complete sentinel file',
563 'action_name': 'chrome_exe_manifest',
565 'app/version_assembly/chrome_exe_manifest_action.gypi',
569 'action_name': 'version_assembly_manifest',
571 'app/version_assembly/version_assembly_manifest_action.gypi',
577 'app/client_util.cc',
580 ['OS=="win" and component=="shared_library"', {
581 'defines': ['COMPILE_CONTENT_STATICALLY'],
585 '../win8/metro_driver/metro_driver.gyp:metro_driver',
586 '../win8/delegate_execute/delegate_execute.gyp:*',
596 'target_name': 'image_pre_reader',
597 'type': 'static_library',
599 'app/image_pre_reader_win.cc',
600 'app/image_pre_reader_win.h',
603 '../base/base.gyp:base',
608 ['disable_nacl!=1 and target_arch=="ia32"', {
611 'target_name': 'chrome_nacl_win64',
612 'type': 'executable',
613 'product_name': 'nacl64',
615 'app/chrome_breakpad_client.cc',
616 'common/crash_keys.cc',
617 'nacl/nacl_exe_win_64.cc',
618 '../content/app/startup_helper_win.cc',
619 '../content/common/sandbox_init_win.cc',
620 '../content/common/sandbox_win.cc',
621 '../content/public/common/content_switches.cc',
622 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/nacl64_exe_version.rc',
625 'chrome_version_resources',
626 'installer_util_nacl_win64',
627 '../base/base.gyp:base_i18n_nacl_win64',
628 '../base/base.gyp:base_win64',
629 '../base/base.gyp:base_static_win64',
630 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
631 '../breakpad/breakpad.gyp:breakpad_handler_win64',
632 '../breakpad/breakpad.gyp:breakpad_sender_win64',
633 '../components/components.gyp:breakpad_win64',
634 '../chrome/common_constants.gyp:common_constants_win64',
635 '../components/components.gyp:policy_win64',
636 '../components/nacl.gyp:nacl_win64',
637 '../crypto/crypto.gyp:crypto_nacl_win64',
638 '../ipc/ipc.gyp:ipc_win64',
639 '../sandbox/sandbox.gyp:sandbox_win64',
642 '<@(nacl_win64_defines)',
643 'COMPILE_CONTENT_STATICALLY',
646 '<(SHARED_INTERMEDIATE_DIR)/chrome',
650 'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
651 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
656 'msvs_target_platform': 'x64',
661 }, { # else (disable_nacl==1)
664 'target_name': 'chrome_nacl_win64',
672 ['test_isolation_mode != "noop"', {
675 'target_name': 'chrome_run',
681 '../build/isolate.gypi',