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