chrome.gyp revision a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7
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.
4{
5  'variables': {
6    'chromium_code': 1,
7
8    # Define the common dependencies that contain all the actual
9    # Chromium functionality.  This list gets pulled in below by
10    # the link of the actual chrome (or chromium) executable on
11    # Linux or Mac, and into chrome.dll on Windows.
12    # NOTE: Most new includes should go in the OS!="ios" condition below.
13    'chromium_browser_dependencies': [
14      'common',
15      'browser',
16      '../sync/sync.gyp:sync',
17    ],
18    'chromium_child_dependencies': [
19      'common',
20      '../sync/sync.gyp:sync',
21    ],
22    'allocator_target': '../base/allocator/allocator.gyp:allocator',
23    'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
24    'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
25    'repack_locales_cmd': ['python', 'tools/build/repack_locales.py'],
26    # TODO: remove this helper when we have loops in GYP
27    'apply_locales_cmd': ['python', '<(DEPTH)/build/apply_locales.py'],
28    'conditions': [
29      ['OS!="ios"', {
30        'chromium_browser_dependencies': [
31          '../ppapi/ppapi_internal.gyp:ppapi_host',
32        ],
33        'chromium_child_dependencies': [
34          'debugger',
35          'plugin',
36          'renderer',
37          'utility',
38          '../content/content.gyp:content_gpu',
39          '../content/content.gyp:content_ppapi_plugin',
40          '../content/content.gyp:content_worker',
41          '../third_party/WebKit/public/blink_devtools.gyp:blink_devtools_frontend_resources',
42        ],
43      }],
44      ['enable_printing!=0', {
45        'chromium_browser_dependencies': [
46          '../printing/printing.gyp:printing',
47        ],
48      }],
49      ['OS=="win"', {
50        'platform_locale_settings_grd':
51            'app/resources/locale_settings_win.grd',
52      },],
53      ['enable_printing==1', {
54        'chromium_browser_dependencies': [
55          'service',
56        ],
57      }],
58      ['OS=="linux"', {
59        'conditions': [
60          ['chromeos==1', {
61            'conditions': [
62              ['branding=="Chrome"', {
63                'platform_locale_settings_grd':
64                    'app/resources/locale_settings_google_chromeos.grd',
65              }, {  # branding!=Chrome
66                'platform_locale_settings_grd':
67                    'app/resources/locale_settings_chromiumos.grd',
68              }],
69            ]
70          }, {  # chromeos==0
71            'platform_locale_settings_grd':
72                'app/resources/locale_settings_linux.grd',
73          }],
74        ],
75      },],
76      ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "linux"', {
77        'platform_locale_settings_grd':
78            'app/resources/locale_settings_linux.grd',
79      },],
80      ['OS=="mac"', {
81        'tweak_info_plist_path': '../build/mac/tweak_info_plist.py',
82        'platform_locale_settings_grd':
83            'app/resources/locale_settings_mac.grd',
84        'conditions': [
85          ['branding=="Chrome"', {
86            'mac_bundle_id': 'com.google.Chrome',
87            'mac_creator': 'rimZ',
88            # The policy .grd file also needs the bundle id.
89            'grit_defines': ['-D', 'mac_bundle_id=com.google.Chrome'],
90          }, {  # else: branding!="Chrome"
91            'mac_bundle_id': 'org.chromium.Chromium',
92            'mac_creator': 'Cr24',
93            # The policy .grd file also needs the bundle id.
94            'grit_defines': ['-D', 'mac_bundle_id=org.chromium.Chromium'],
95          }],  # branding
96        ],  # conditions
97      }],  # OS=="mac"
98    ],  # conditions
99  },  # variables
100  'includes': [
101    # Place some targets in gypi files to reduce contention on this file.
102    # By using an include, we keep everything in a single xcodeproj file.
103    # Note on Win64 targets: targets that end with win64 be used
104    # on 64-bit Windows only. Targets that end with nacl_win64 should be used
105    # by Native Client only.
106    # NOTE: Most new includes should go in the OS!="ios" condition below.
107    '../build/win_precompile.gypi',
108    'chrome_browser.gypi',
109    'chrome_browser_ui.gypi',
110    'chrome_common.gypi',
111    'chrome_installer_util.gypi',
112    'version.gypi',
113    '../components/nacl/nacl_defines.gypi',
114  ],
115  'conditions': [
116    ['OS!="ios"', {
117      'includes': [
118        'app/policy/policy_templates.gypi',
119        'chrome_browser_extensions.gypi',
120        'chrome_dll.gypi',
121        'chrome_exe.gypi',
122        'chrome_installer.gypi',
123        'chrome_renderer.gypi',
124        'chrome_tests.gypi',
125        'chrome_tests_unit.gypi',
126        '../apps/apps.gypi',
127      ],
128      'targets': [
129        {
130          'target_name': 'default_extensions',
131          'type': 'none',
132          'conditions': [
133            ['OS=="win"', {
134              'copies': [
135                {
136                  'destination': '<(PRODUCT_DIR)/extensions',
137                  'files': [
138                    'browser/extensions/default_extensions/external_extensions.json'
139                  ]
140                }
141              ],
142            }]
143          ],
144        },
145        {
146          'target_name': 'debugger',
147          'type': 'static_library',
148          'variables': { 'enable_wexit_time_destructors': 1, },
149          'dependencies': [
150            'chrome_resources.gyp:chrome_extra_resources',
151            'chrome_resources.gyp:chrome_resources',
152            'chrome_resources.gyp:chrome_strings',
153            'chrome_resources.gyp:theme_resources',
154            'common/extensions/api/api.gyp:api',
155            '../base/base.gyp:base',
156            '../content/content.gyp:content_browser',
157            '../net/net.gyp:http_server',
158            '../net/net.gyp:net',
159            '../skia/skia.gyp:skia',
160            '../third_party/icu/icu.gyp:icui18n',
161            '../third_party/icu/icu.gyp:icuuc',
162            '../third_party/leveldatabase/leveldatabase.gyp:leveldatabase',
163            '../third_party/libusb/libusb.gyp:libusb',
164          ],
165          'include_dirs': [
166            '..',
167          ],
168          'sources': [
169            'browser/devtools/adb/android_rsa.cc',
170            'browser/devtools/adb/android_rsa.h',
171            'browser/devtools/adb/android_usb_device.cc',
172            'browser/devtools/adb/android_usb_device.h',
173            'browser/devtools/adb/android_usb_socket.cc',
174            'browser/devtools/adb/android_usb_socket.h',
175            'browser/devtools/adb_client_socket.cc',
176            'browser/devtools/adb_client_socket.h',
177            'browser/devtools/adb_web_socket.cc',
178            'browser/devtools/adb_web_socket.h',
179            'browser/devtools/android_device.cc',
180            'browser/devtools/android_device.h',
181            'browser/devtools/browser_list_tabcontents_provider.cc',
182            'browser/devtools/browser_list_tabcontents_provider.h',
183            'browser/devtools/devtools_adb_bridge.cc',
184            'browser/devtools/devtools_adb_bridge.h',
185            'browser/devtools/devtools_embedder_message_dispatcher.cc',
186            'browser/devtools/devtools_embedder_message_dispatcher.h',
187            'browser/devtools/devtools_file_helper.cc',
188            'browser/devtools/devtools_file_helper.h',
189            'browser/devtools/devtools_file_system_indexer.cc',
190            'browser/devtools/devtools_file_system_indexer.h',
191            'browser/devtools/devtools_protocol.cc',
192            'browser/devtools/devtools_protocol.h',
193            'browser/devtools/devtools_target_impl.cc',
194            'browser/devtools/devtools_target_impl.h',
195            'browser/devtools/devtools_targets_ui.cc',
196            'browser/devtools/devtools_targets_ui.h',
197            'browser/devtools/devtools_toggle_action.cc',
198            'browser/devtools/devtools_toggle_action.h',
199            'browser/devtools/devtools_window.cc',
200            'browser/devtools/devtools_window.h',
201            'browser/devtools/port_forwarding_controller.cc',
202            'browser/devtools/port_forwarding_controller.h',
203            'browser/devtools/refcounted_adb_thread.cc',
204            'browser/devtools/refcounted_adb_thread.h',
205            'browser/devtools/remote_debugging_server.cc',
206            'browser/devtools/remote_debugging_server.h',
207          ],
208          'conditions': [
209            ['toolkit_uses_gtk == 1', {
210              'dependencies': [
211                '../build/linux/system.gyp:gtk',
212              ],
213            }],
214            ['OS=="android"', {
215              'dependencies!': [
216                '../third_party/libusb/libusb.gyp:libusb',
217              ],
218              'sources!': [
219                'browser/devtools/adb/android_rsa.cc',
220                'browser/devtools/browser_list_tabcontents_provider.cc',
221                'browser/devtools/devtools_file_system_indexer.cc',
222                'browser/devtools/devtools_target_impl.cc',
223                'browser/devtools/devtools_window.cc',
224                'browser/devtools/remote_debugging_server.cc',
225              ],
226            }],
227            ['debug_devtools==1', {
228              'defines': [
229                'DEBUG_DEVTOOLS=1',
230               ],
231            }],
232          ],
233          # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
234          'msvs_disabled_warnings': [ 4267, ],
235        },
236        {
237          'target_name': 'plugin',
238          'type': 'static_library',
239          'variables': { 'enable_wexit_time_destructors': 1, },
240          'dependencies': [
241            'chrome_resources.gyp:chrome_strings',
242            '../base/base.gyp:base',
243            '../content/content.gyp:content_plugin',
244          ],
245          'sources': [
246            'plugin/chrome_content_plugin_client.cc',
247            'plugin/chrome_content_plugin_client.h',
248          ],
249          'include_dirs': [
250            '..',
251            '<(grit_out_dir)',
252          ],
253        },
254        {
255          'target_name': 'utility',
256          'type': 'static_library',
257          'variables': { 'enable_wexit_time_destructors': 1, },
258          'dependencies': [
259            'common/extensions/api/api.gyp:api',
260            '../base/base.gyp:base',
261            '../content/content.gyp:content_utility',
262            '../media/media.gyp:media',
263            '../skia/skia.gyp:skia',
264            '../third_party/libxml/libxml.gyp:libxml',
265            'common',
266            '<(DEPTH)/chrome/chrome_resources.gyp:chrome_resources',
267            '<(DEPTH)/chrome/chrome_resources.gyp:chrome_strings',
268          ],
269          'sources': [
270            'utility/chrome_content_utility_client.cc',
271            'utility/chrome_content_utility_client.h',
272            'utility/cloud_print/bitmap_image.cc',
273            'utility/cloud_print/bitmap_image.h',
274            'utility/cloud_print/pwg_encoder.cc',
275            'utility/cloud_print/pwg_encoder.h',
276            'utility/extensions/unpacker.cc',
277            'utility/extensions/unpacker.h',
278            'utility/importer/bookmark_html_reader.cc',
279            'utility/importer/bookmark_html_reader.h',
280            'utility/importer/bookmarks_file_importer.cc',
281            'utility/importer/bookmarks_file_importer.h',
282            'utility/importer/external_process_importer_bridge.cc',
283            'utility/importer/external_process_importer_bridge.h',
284            'utility/importer/favicon_reencode.cc',
285            'utility/importer/favicon_reencode.h',
286            'utility/importer/firefox_importer.cc',
287            'utility/importer/firefox_importer.h',
288            'utility/importer/firefox_importer_unittest_messages_internal.h',
289            'utility/importer/firefox_importer_unittest_utils.h',
290            'utility/importer/firefox_importer_unittest_utils_mac.cc',
291            'utility/importer/ie_importer_win.cc',
292            'utility/importer/ie_importer_win.h',
293            'utility/importer/importer.cc',
294            'utility/importer/importer.h',
295            'utility/importer/importer_creator.cc',
296            'utility/importer/importer_creator.h',
297            'utility/importer/nss_decryptor.cc',
298            'utility/importer/nss_decryptor.h',
299            'utility/importer/nss_decryptor_mac.h',
300            'utility/importer/nss_decryptor_mac.mm',
301            'utility/importer/nss_decryptor_win.cc',
302            'utility/importer/nss_decryptor_win.h',
303            'utility/importer/safari_importer.h',
304            'utility/importer/safari_importer.mm',
305            'utility/media_galleries/itunes_pref_parser_win.cc',
306            'utility/media_galleries/itunes_pref_parser_win.h',
307            'utility/media_galleries/media_metadata_parser.cc',
308            'utility/media_galleries/media_metadata_parser.h',
309            'utility/profile_import_handler.cc',
310            'utility/profile_import_handler.h',
311            'utility/utility_message_handler.h',
312            'utility/web_resource_unpacker.cc',
313            'utility/web_resource_unpacker.h',
314          ],
315          'include_dirs': [
316            '..',
317            '<(grit_out_dir)',
318          ],
319          'conditions': [
320            ['toolkit_uses_gtk == 1', {
321              'dependencies': [
322                '../build/linux/system.gyp:gtk',
323              ],
324            }],
325            ['OS=="win" or OS=="mac"', {
326              'sources': [
327                'utility/media_galleries/iapps_xml_utils.cc',
328                'utility/media_galleries/iapps_xml_utils.h',
329                'utility/media_galleries/itunes_library_parser.cc',
330                'utility/media_galleries/itunes_library_parser.h',
331                'utility/media_galleries/picasa_album_table_reader.cc',
332                'utility/media_galleries/picasa_album_table_reader.h',
333                'utility/media_galleries/picasa_albums_indexer.cc',
334                'utility/media_galleries/picasa_albums_indexer.h',
335                'utility/media_galleries/pmp_column_reader.cc',
336                'utility/media_galleries/pmp_column_reader.h',
337              ],
338            }],
339            ['OS=="mac"', {
340              'sources': [
341                'utility/media_galleries/iphoto_library_parser.cc',
342                'utility/media_galleries/iphoto_library_parser.h',
343              ],
344            }],
345            ['use_openssl==1', {
346              'sources!': [
347                'utility/importer/nss_decryptor.cc',
348              ]
349            }],
350            ['OS!="win" and OS!="mac" and use_openssl==0', {
351              'dependencies': [
352                '../crypto/crypto.gyp:crypto',
353              ],
354              'sources': [
355                'utility/importer/nss_decryptor_system_nss.cc',
356                'utility/importer/nss_decryptor_system_nss.h',
357              ],
358            }],
359            ['OS=="android"', {
360              'sources/': [
361                ['exclude', '^utility/importer/'],
362                ['exclude', '^utility/media_galleries/'],
363                ['exclude', '^utility/profile_import_handler\.cc'],
364              ],
365            }],
366            ['enable_mdns == 1', {
367              'sources': [
368                'utility/local_discovery/service_discovery_client_impl.cc',
369                'utility/local_discovery/service_discovery_client_impl.h',
370                'utility/local_discovery/service_discovery_message_handler.cc',
371                'utility/local_discovery/service_discovery_message_handler.h',
372              ]
373            }],
374          ],
375          # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
376          'msvs_disabled_warnings': [ 4267, ],
377        },
378      ],
379    }],  # OS!="ios"
380    ['OS=="mac"', {
381      'includes': [
382        '../apps/app_shim/app_shim.gypi',
383      ],
384      'targets': [
385        {
386          'target_name': 'helper_app',
387          'type': 'executable',
388          'variables': { 'enable_wexit_time_destructors': 1, },
389          'product_name': '<(mac_product_name) Helper',
390          'mac_bundle': 1,
391          'dependencies': [
392            'chrome_dll',
393            'infoplist_strings_tool',
394          ],
395          'sources': [
396            # chrome_exe_main_mac.cc's main() is the entry point for
397            # the "chrome" (browser app) target.  All it does is jump
398            # to chrome_dll's ChromeMain.  This is appropriate for
399            # helper processes too, because the logic to discriminate
400            # between process types at run time is actually directed
401            # by the --type command line argument processed by
402            # ChromeMain.  Sharing chrome_exe_main_mac.cc with the
403            # browser app will suffice for now.
404            'app/chrome_exe_main_mac.cc',
405            'app/helper-Info.plist',
406          ],
407          # TODO(mark): Come up with a fancier way to do this.  It should only
408          # be necessary to list helper-Info.plist once, not the three times it
409          # is listed here.
410          'mac_bundle_resources!': [
411            'app/helper-Info.plist',
412          ],
413          # TODO(mark): For now, don't put any resources into this app.  Its
414          # resources directory will be a symbolic link to the browser app's
415          # resources directory.
416          'mac_bundle_resources/': [
417            ['exclude', '.*'],
418          ],
419          'xcode_settings': {
420            'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
421            'CHROMIUM_SHORT_NAME': '<(branding)',
422            'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves',
423            'INFOPLIST_FILE': 'app/helper-Info.plist',
424          },
425          'postbuilds': [
426            {
427              # The helper doesn't have real localizations, it just has
428              # empty .lproj directories, which is enough to convince Cocoa
429              # that anything running out of the helper .app supports those
430              # languages.
431              'postbuild_name': 'Make Empty Localizations',
432              'variables': {
433                'locale_dirs': [
434                  '>!@(<(apply_locales_cmd) -d ZZLOCALE.lproj <(locales))',
435                ],
436              },
437              'action': [
438                'tools/build/mac/make_locale_dirs.sh',
439                '<@(locale_dirs)',
440              ],
441            },
442            {
443              # The framework (chrome_dll) defines its load-time path
444              # (DYLIB_INSTALL_NAME_BASE) relative to the main executable
445              # (chrome).  A different relative path needs to be used in
446              # helper_app.
447              'postbuild_name': 'Fix Framework Link',
448              'action': [
449                'install_name_tool',
450                '-change',
451                '@executable_path/../Versions/<(version_full)/<(mac_product_name) Framework.framework/<(mac_product_name) Framework',
452                '@executable_path/../../../<(mac_product_name) Framework.framework/<(mac_product_name) Framework',
453                '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
454              ],
455            },
456            {
457              # Modify the Info.plist as needed.  The script explains why this
458              # is needed.  This is also done in the chrome and chrome_dll
459              # targets.  In this case, --breakpad=0, --keystone=0, and --scm=0
460              # are used because Breakpad, Keystone, and SCM keys are
461              # never placed into the helper.
462              'postbuild_name': 'Tweak Info.plist',
463              'action': ['<(tweak_info_plist_path)',
464                         '--breakpad=0',
465                         '--keystone=0',
466                         '--scm=0'],
467            },
468            {
469              # Make sure there isn't any Objective-C in the helper app's
470              # executable.
471              'postbuild_name': 'Verify No Objective-C',
472              'action': [
473                '../build/mac/verify_no_objc.sh',
474              ],
475            },
476          ],
477          'conditions': [
478            ['mac_breakpad==1', {
479              'variables': {
480                # A real .dSYM is needed for dump_syms to operate on.
481                'mac_real_dsym': 1,
482              },
483              'xcode_settings': {
484                # With mac_real_dsym set, strip_from_xcode won't be used.
485                # Specify CHROMIUM_STRIP_SAVE_FILE directly to Xcode.
486                'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
487              },
488            }],
489            ['asan==1', {
490              'xcode_settings': {
491                # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
492                'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
493              },
494            }],
495            ['component=="shared_library"', {
496              'xcode_settings': {
497                'LD_RUNPATH_SEARCH_PATHS': [
498                  # Get back from Chromium.app/Contents/Versions/V/
499                  #                                    Helper.app/Contents/MacOS
500                  '@loader_path/../../../../../../..',
501                ],
502              },
503            }],
504          ],
505        },  # target helper_app
506        {
507          # A library containing the actual code for the app mode app, shared
508          # by unit tests.
509          'target_name': 'app_mode_app_support',
510          'type': 'static_library',
511          'variables': { 'enable_wexit_time_destructors': 1, },
512          'product_name': 'app_mode_app_support',
513          'dependencies': [
514            '../base/base.gyp:base',
515            'common_constants.gyp:common_constants',
516          ],
517          'sources': [
518            'common/mac/app_mode_chrome_locator.h',
519            'common/mac/app_mode_chrome_locator.mm',
520            'common/mac/app_mode_common.h',
521            'common/mac/app_mode_common.mm',
522          ],
523          'include_dirs': [
524            '..',
525          ],
526        },  # target app_mode_app_support
527        {
528          # This produces the template for app mode loader bundles. It's a
529          # template in the sense that parts of it need to be "filled in" by
530          # Chrome before it can be executed.
531          'target_name': 'app_mode_app',
532          'type': 'executable',
533          'mac_bundle' : 1,
534          'variables': { 'enable_wexit_time_destructors': 1, },
535          'product_name': 'app_mode_loader',
536          'dependencies': [
537            'app_mode_app_support',
538            'infoplist_strings_tool',
539          ],
540          'sources': [
541            'app/app_mode_loader_mac.mm',
542            'app/app_mode-Info.plist',
543          ],
544          'include_dirs': [
545            '..',
546          ],
547          'link_settings': {
548            'libraries': [
549              '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
550              '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
551            ],
552          },
553          'mac_bundle_resources!': [
554            'app/app_mode-Info.plist',
555          ],
556          'mac_bundle_resources/': [
557            ['exclude', '.*'],
558          ],
559          'xcode_settings': {
560            'INFOPLIST_FILE': 'app/app_mode-Info.plist',
561            'APP_MODE_APP_BUNDLE_ID': '<(mac_bundle_id).app.@APP_MODE_SHORTCUT_ID@',
562          },
563          'postbuilds' : [
564            {
565              # Modify the Info.plist as needed.  The script explains why this
566              # is needed.  This is also done in the chrome and chrome_dll
567              # targets.  In this case, --breakpad=0, --keystone=0, and --scm=0
568              # are used because Breakpad, Keystone, and SCM keys are
569              # never placed into the app mode loader.
570              'postbuild_name': 'Tweak Info.plist',
571              'action': ['<(tweak_info_plist_path)',
572                         '--breakpad=0',
573                         '--keystone=0',
574                         '--scm=0'],
575            },
576          ],
577        },  # target app_mode_app
578        {
579          # Convenience target to build a disk image.
580          'target_name': 'build_app_dmg',
581          # Don't place this in the 'all' list; most won't want it.
582          # In GYP, booleans are 0/1, not True/False.
583          'suppress_wildcard': 1,
584          'type': 'none',
585          'dependencies': [
586            'chrome',
587          ],
588          'variables': {
589            'build_app_dmg_script_path': 'tools/build/mac/build_app_dmg',
590            'pkg_dmg_script_path': 'installer/mac/pkg-dmg',
591
592            'conditions': [
593              # This duplicates the output path from build_app_dmg.
594              ['branding=="Chrome"', {
595                'dmg_name': 'GoogleChrome.dmg',
596              }, { # else: branding!="Chrome"
597                'dmg_name': 'Chromium.dmg',
598              }],
599            ],
600          },
601          'actions': [
602            {
603              'inputs': [
604                '<(build_app_dmg_script_path)',
605                '<(pkg_dmg_script_path)',
606                '<(PRODUCT_DIR)/<(mac_product_name).app',
607              ],
608              'outputs': [
609                '<(PRODUCT_DIR)/<(dmg_name)',
610              ],
611              'action_name': 'build_app_dmg',
612              'action': ['<(build_app_dmg_script_path)', '<@(branding)'],
613            },
614          ],  # 'actions'
615        },
616        {
617          # Dummy target to allow chrome to require plugin_carbon_interpose to
618          # build without actually linking to the resulting library.
619          'target_name': 'interpose_dependency_shim',
620          'type': 'executable',
621          'variables': { 'enable_wexit_time_destructors': 1, },
622          'dependencies': [
623            'plugin_carbon_interpose',
624          ],
625          # In release, we end up with a strip step that is unhappy if there is
626          # no binary. Rather than check in a new file for this temporary hack,
627          # just generate a source file on the fly.
628          'actions': [
629            {
630              'action_name': 'generate_stub_main',
631              'process_outputs_as_sources': 1,
632              'inputs': [],
633              'outputs': [ '<(INTERMEDIATE_DIR)/dummy_main.c' ],
634              'action': [
635                'bash', '-c',
636                'echo "int main() { return 0; }" > <(INTERMEDIATE_DIR)/dummy_main.c'
637              ],
638            },
639          ],
640        },
641        {
642          # dylib for interposing Carbon calls in the plugin process.
643          'target_name': 'plugin_carbon_interpose',
644          'type': 'shared_library',
645          'variables': { 'enable_wexit_time_destructors': 1, },
646          # This target must not depend on static libraries, else the code in
647          # those libraries would appear twice in plugin processes: Once from
648          # Chromium Framework, and once from this dylib.
649          'dependencies': [
650            'chrome_dll',
651          ],
652          'conditions': [
653            ['component=="shared_library"', {
654              'dependencies': [
655                '../content/content.gyp:content_plugin',
656                '../webkit/glue/webkit_glue.gyp:glue',
657              ],
658              'xcode_settings': {
659                'LD_RUNPATH_SEARCH_PATHS': [
660                  # Get back from Chromium.app/Contents/Versions/V
661                  '@loader_path/../../../..',
662                ],
663              },
664            }],
665          ],
666          'sources': [
667            '../content/plugin/plugin_carbon_interpose_mac.cc',
668          ],
669          'include_dirs': [
670            '..',
671          ],
672          'link_settings': {
673            'libraries': [
674              '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
675            ],
676          },
677          'xcode_settings': {
678            'DYLIB_COMPATIBILITY_VERSION': '<(version_mac_dylib)',
679            'DYLIB_CURRENT_VERSION': '<(version_mac_dylib)',
680            'DYLIB_INSTALL_NAME_BASE': '@executable_path/../../..',
681          },
682          'postbuilds': [
683            {
684              # The framework (chrome_dll) defines its load-time path
685              # (DYLIB_INSTALL_NAME_BASE) relative to the main executable
686              # (chrome).  A different relative path needs to be used in
687              # plugin_carbon_interpose, which runs in the helper_app.
688              'postbuild_name': 'Fix Framework Link',
689              'action': [
690                'install_name_tool',
691                '-change',
692                '@executable_path/../Versions/<(version_full)/<(mac_product_name) Framework.framework/<(mac_product_name) Framework',
693                '@executable_path/../../../<(mac_product_name) Framework.framework/<(mac_product_name) Framework',
694                '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
695              ],
696            },
697          ],
698        },
699        {
700          'target_name': 'infoplist_strings_tool',
701          'type': 'executable',
702          'variables': { 'enable_wexit_time_destructors': 1, },
703          'dependencies': [
704            'chrome_resources.gyp:chrome_strings',
705            '../base/base.gyp:base',
706            '../ui/gfx/gfx.gyp:gfx',
707            '../ui/ui.gyp:ui',
708          ],
709          'include_dirs': [
710            '<(grit_out_dir)',
711          ],
712          'sources': [
713            'tools/mac_helpers/infoplist_strings_util.mm',
714          ],
715        },
716      ],  # targets
717    }],  # OS=="mac"
718    ['OS=="linux"',
719      { 'targets': [
720        {
721          'target_name': 'linux_symbols',
722          'type': 'none',
723          'conditions': [
724            ['linux_dump_symbols==1', {
725              'actions': [
726                {
727                  'action_name': 'dump_symbols',
728                  'inputs': [
729                    '<(DEPTH)/build/linux/dump_app_syms',
730                    '<(PRODUCT_DIR)/dump_syms',
731                    '<(PRODUCT_DIR)/chrome',
732                  ],
733                  'outputs': [
734                    '<(PRODUCT_DIR)/chrome.breakpad.<(target_arch)',
735                  ],
736                  'action': ['<(DEPTH)/build/linux/dump_app_syms',
737                             '<(PRODUCT_DIR)/dump_syms',
738                             '<(linux_strip_binary)',
739                             '<(PRODUCT_DIR)/chrome',
740                             '<@(_outputs)'],
741                  'message': 'Dumping breakpad symbols to <(_outputs)',
742                  'process_outputs_as_sources': 1,
743                },
744              ],
745              'dependencies': [
746                'chrome',
747                '../breakpad/breakpad.gyp:dump_syms',
748              ],
749            }],
750            ['linux_strip_reliability_tests==1', {
751              'actions': [
752                {
753                  'action_name': 'strip_reliability_tests',
754                  'inputs': [
755                    '<(PRODUCT_DIR)/_pyautolib.so',
756                  ],
757                  'outputs': [
758                    '<(PRODUCT_DIR)/strip_reliability_tests.stamp',
759                  ],
760                  'action': ['strip',
761                             '-g',
762                             '<@(_inputs)'],
763                  'message': 'Stripping reliability tests',
764                },
765              ],
766            }],
767          ],
768        },
769      ],
770    }],  # OS=="linux"
771    ['OS=="win"',
772      { 'targets': [
773        {
774          # For historical reasons, chrome/chrome.sln has been the entry point
775          # for new Chrome developers. To assist development, include several
776          # core unittests that are otherwise only accessible side-by-side with
777          # chrome via all/all.sln.
778          'target_name': 'test_targets',
779          'type': 'none',
780          'dependencies': [
781            '../base/base.gyp:base_unittests',
782            '../chrome_frame/chrome_frame.gyp:chrome_frame_tests',
783            '../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests',
784            '../content/content_shell_and_tests.gyp:content_browsertests',
785            '../content/content_shell_and_tests.gyp:content_shell',
786            '../content/content_shell_and_tests.gyp:content_unittests',
787            '../net/net.gyp:net_unittests',
788            '../ui/ui_unittests.gyp:ui_unittests',
789          ],
790          'conditions': [
791            ['use_aura==1 or target_arch=="x64"', {
792              'dependencies!': [
793                '../chrome_frame/chrome_frame.gyp:chrome_frame_tests',
794                '../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests',
795              ],
796            }],
797          ],
798        },
799        {
800          'target_name': 'chrome_version_resources',
801          'type': 'none',
802          'conditions': [
803            ['branding == "Chrome"', {
804              'variables': {
805                 'branding_path': 'app/theme/google_chrome/BRANDING',
806              },
807            }, { # else branding!="Chrome"
808              'variables': {
809                 'branding_path': 'app/theme/chromium/BRANDING',
810              },
811            }],
812          ],
813          'variables': {
814            'output_dir': 'chrome_version',
815            'template_input_path': 'app/chrome_version.rc.version',
816          },
817          'direct_dependent_settings': {
818            'include_dirs': [
819              '<(SHARED_INTERMEDIATE_DIR)/<(output_dir)',
820            ],
821          },
822          'sources': [
823            'app/chrome_exe.ver',
824            'app/chrome_dll.ver',
825            'app/nacl64_exe.ver',
826            'app/other.ver',
827          ],
828          'includes': [
829            'version_resource_rules.gypi',
830          ],
831        },
832        {
833          'target_name': 'chrome_version_header',
834          'type': 'none',
835          'hard_dependency': 1,
836          'actions': [
837            {
838              'action_name': 'version_header',
839              'variables': {
840                'lastchange_path':
841                  '<(DEPTH)/build/util/LASTCHANGE',
842              },
843              'conditions': [
844                ['branding == "Chrome"', {
845                  'variables': {
846                     'branding_path': 'app/theme/google_chrome/BRANDING',
847                  },
848                }, { # else branding!="Chrome"
849                  'variables': {
850                     'branding_path': 'app/theme/chromium/BRANDING',
851                  },
852                }],
853              ],
854              'inputs': [
855                '<(version_path)',
856                '<(branding_path)',
857                '<(lastchange_path)',
858                'version.h.in',
859              ],
860              'outputs': [
861                '<(SHARED_INTERMEDIATE_DIR)/version.h',
862              ],
863              'action': [
864                'python',
865                '<(version_py_path)',
866                '-f', '<(version_path)',
867                '-f', '<(branding_path)',
868                '-f', '<(lastchange_path)',
869                'version.h.in',
870                '<@(_outputs)',
871              ],
872              'message': 'Generating version header file: <@(_outputs)',
873            },
874          ],
875        },
876        {
877          'target_name': 'automation',
878          'type': 'static_library',
879          'dependencies': [
880            'chrome_resources.gyp:theme_resources',
881            '../skia/skia.gyp:skia',
882          ],
883          'include_dirs': [
884            '..',
885          ],
886          'sources': [
887             'test/automation/automation_handle_tracker.cc',
888             'test/automation/automation_handle_tracker.h',
889             'test/automation/automation_proxy.cc',
890             'test/automation/automation_proxy.h',
891             'test/automation/browser_proxy.cc',
892             'test/automation/browser_proxy.h',
893             'test/automation/tab_proxy.cc',
894             'test/automation/tab_proxy.h',
895             'test/automation/window_proxy.cc',
896             'test/automation/window_proxy.h',
897          ],
898        },
899        {
900          'target_name': 'crash_service',
901          'type': 'executable',
902          'dependencies': [
903            'installer_util',
904            '../base/base.gyp:base',
905            '../chrome/common_constants.gyp:common_constants',
906            '../components/components.gyp:breakpad_crash_service',
907          ],
908          'include_dirs': [
909            '..',
910          ],
911          'sources': [
912            'tools/crash_service/main.cc',
913          ],
914          'msvs_settings': {
915            'VCLinkerTool': {
916              'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
917            },
918          },
919        },
920        {
921          'target_name': 'sb_sigutil',
922          'type': 'executable',
923          'dependencies': [
924            '../base/base.gyp:base',
925            'safe_browsing_proto',
926          ],
927          'sources': [
928            'browser/safe_browsing/signature_util.h',
929            'browser/safe_browsing/signature_util_win.cc',
930            'tools/safe_browsing/sb_sigutil.cc',
931          ],
932        },
933      ],  # 'targets'
934      'includes': [
935        'chrome_process_finder.gypi',
936        'metro_utils.gypi',
937      ],
938    }],  # OS=="win"
939    ['OS=="win" and target_arch=="ia32"',
940      { 'targets': [
941        {
942          'target_name': 'chrome_user32_delay_imports',
943          'type': 'none',
944          'variables': {
945            'lib_dir': '<(INTERMEDIATE_DIR)',
946          },
947          'sources': [
948              'chrome.user32.delay.imports'
949          ],
950          'includes': [
951              '../build/win/importlibs/create_import_lib.gypi',
952          ],
953          'direct_dependent_settings': {
954            'msvs_settings': {
955              'VCLinkerTool': {
956                'AdditionalLibraryDirectories': ['<(lib_dir)', ],
957                'AdditionalDependencies': ['chrome.user32.delay.lib', ],
958              },
959            },
960          },
961        },
962        {
963          'target_name': 'crash_service_win64',
964          'type': 'executable',
965          'product_name': 'crash_service64',
966          'dependencies': [
967            'installer_util_nacl_win64',
968            '../base/base.gyp:base_static_win64',
969            '../chrome/common_constants.gyp:common_constants_win64',
970            '../components/components.gyp:breakpad_crash_service_win64',
971          ],
972          'include_dirs': [
973            '..',
974          ],
975          'sources': [
976            'tools/crash_service/main.cc',
977            '../content/public/common/content_switches.cc',
978          ],
979          'defines': [
980            'COMPILE_CONTENT_STATICALLY',
981          ],
982          'msvs_settings': {
983            'VCLinkerTool': {
984              'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
985            },
986          },
987          'configurations': {
988            'Common_Base': {
989              'msvs_target_platform': 'x64',
990            },
991          },
992        },
993      ]},  # 'targets'
994    ],  # OS=="win" and target_arch=="ia32"
995    ['chromeos==1', {
996      'includes': [ 'chrome_browser_chromeos.gypi' ],
997    }],  # chromeos==1
998    ['OS=="android"',
999      {
1000      'targets': [
1001        {
1002          'target_name': 'chrome_java',
1003          'type': 'none',
1004          'dependencies': [
1005            'chrome_resources.gyp:chrome_strings',
1006            'profile_sync_service_model_type_selection_java',
1007            'resource_id_java',
1008            'toolbar_model_security_levels_java',
1009            '../base/base.gyp:base',
1010            '../components/components.gyp:autofill_java',
1011            '../components/components.gyp:navigation_interception_java',
1012            '../components/components.gyp:sessions',
1013            '../components/components.gyp:web_contents_delegate_android_java',
1014            '../content/content.gyp:content_java',
1015            '../printing/printing.gyp:printing_java',
1016            '../sync/sync.gyp:sync_java',
1017            '../third_party/guava/guava.gyp:guava_javalib',
1018            '../ui/android/ui_android.gyp:ui_java',
1019          ],
1020          'variables': {
1021            'java_in_dir': '../chrome/android/java',
1022            'has_java_resources': 1,
1023            'R_package': 'org.chromium.chrome',
1024            'R_package_relpath': 'org/chromium/chrome',
1025            'java_strings_grd': 'android_chrome_strings.grd',
1026            # Include xml string files generated from generated_resources.grd
1027            'res_extra_dirs': ['<(SHARED_INTERMEDIATE_DIR)/chrome/java/res'],
1028            'res_extra_files': ['<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(SHARED_INTERMEDIATE_DIR)/chrome" app/generated_resources.grd)'],
1029          },
1030          'includes': [
1031            '../build/java.gypi',
1032          ],
1033        },
1034      ], # 'targets'
1035      'includes': [
1036        'chrome_android.gypi',
1037      ]}, # 'includes'
1038    ],  # OS=="android"
1039    ['configuration_policy==1 and OS!="android"', {
1040      'includes': [ 'policy.gypi', ],
1041    }],
1042    ['enable_printing==1', {
1043      'targets': [
1044        {
1045          'target_name': 'service',
1046          'type': 'static_library',
1047          'variables': { 'enable_wexit_time_destructors': 1, },
1048          'dependencies': [
1049            'chrome_resources.gyp:chrome_strings',
1050            'common',
1051            'common_net',
1052            '../base/base.gyp:base',
1053            '../google_apis/google_apis.gyp:google_apis',
1054            '../jingle/jingle.gyp:notifier',
1055            '../net/net.gyp:net',
1056            '../printing/printing.gyp:printing',
1057            '../skia/skia.gyp:skia',
1058            '../third_party/libjingle/libjingle.gyp:libjingle',
1059          ],
1060          'sources': [
1061            'service/chrome_service_application_mac.h',
1062            'service/chrome_service_application_mac.mm',
1063            'service/service_ipc_server.cc',
1064            'service/service_ipc_server.h',
1065            'service/service_main.cc',
1066            'service/service_process.cc',
1067            'service/service_process.h',
1068            'service/service_process_prefs.cc',
1069            'service/service_process_prefs.h',
1070            'service/service_utility_process_host.cc',
1071            'service/service_utility_process_host.h',
1072            'service/cloud_print/cloud_print_auth.cc',
1073            'service/cloud_print/cloud_print_auth.h',
1074            'service/cloud_print/cloud_print_connector.cc',
1075            'service/cloud_print/cloud_print_connector.h',
1076            'service/cloud_print/cloud_print_service_helpers.cc',
1077            'service/cloud_print/cloud_print_service_helpers.h',
1078            'service/cloud_print/cloud_print_proxy.cc',
1079            'service/cloud_print/cloud_print_proxy.h',
1080            'service/cloud_print/cloud_print_proxy_backend.cc',
1081            'service/cloud_print/cloud_print_proxy_backend.h',
1082            'service/cloud_print/cloud_print_token_store.cc',
1083            'service/cloud_print/cloud_print_token_store.h',
1084            'service/cloud_print/cloud_print_url_fetcher.cc',
1085            'service/cloud_print/cloud_print_url_fetcher.h',
1086            'service/cloud_print/cloud_print_wipeout.cc',
1087            'service/cloud_print/cloud_print_wipeout.h',
1088            'service/cloud_print/connector_settings.cc',
1089            'service/cloud_print/connector_settings.h',
1090            'service/cloud_print/job_status_updater.cc',
1091            'service/cloud_print/job_status_updater.h',
1092            'service/cloud_print/print_system.cc',
1093            'service/cloud_print/print_system.h',
1094            'service/cloud_print/printer_job_handler.cc',
1095            'service/cloud_print/printer_job_handler.h',
1096            'service/cloud_print/printer_job_queue_handler.cc',
1097            'service/cloud_print/printer_job_queue_handler.h',
1098            'service/net/service_url_request_context.cc',
1099            'service/net/service_url_request_context.h',
1100          ],
1101          'include_dirs': [
1102            '..',
1103          ],
1104          'conditions': [
1105            ['OS=="win"', {
1106              'sources': [
1107                'service/cloud_print/print_system_win.cc',
1108                'service/cloud_print/print_system_win.h',
1109                'service/cloud_print/print_system_xps_win.cc',
1110              ],
1111            }],
1112            ['toolkit_uses_gtk == 1', {
1113              'dependencies': [
1114                '../build/linux/system.gyp:gtk',
1115              ],
1116            }],
1117            ['use_cups==1', {
1118              'dependencies': [
1119                '../printing/printing.gyp:cups',
1120              ],
1121              'sources': [
1122                'service/cloud_print/print_system_cups.cc',
1123              ],
1124            }],
1125            ['OS!="win" and use_cups!=1', {
1126              'sources': [
1127                'service/cloud_print/print_system_dummy.cc',
1128              ],
1129            }],
1130          ],
1131        },
1132      ],
1133    }],
1134  ],  # 'conditions'
1135}
1136