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