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