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