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