Fixed service side implementation of glTexStorage2DEXT to only initialize the number of
[chromium-blink-merge.git] / chrome / chrome_exe.gypi
blobd2f220666bd52d02cf8bcb5507c3a3335f155acb
1 # Copyright (c) 2011 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.
6   'targets': [
7     {
8       'target_name': 'chrome',
9       'type': 'executable',
10       'mac_bundle': 1,
11       'variables': {
12         'use_system_xdg_utils%': 0,
13         'enable_wexit_time_destructors': 1,
14       },
15       'sources': [
16         'app/breakpad_win.cc',
17         'app/breakpad_win.h',
18         'app/chrome_exe_main_aura.cc',
19         'app/chrome_exe_main_gtk.cc',
20         'app/chrome_exe_main_mac.cc',
21         'app/chrome_exe_main_win.cc',
22         'app/chrome_exe_resource.h',
23         'app/client_util.cc',
24         'app/client_util.h',
25         'app/hard_error_handler_win.cc',
26         'app/hard_error_handler_win.h',
27         'app/scoped_ole_initializer.h',
28         '../content/app/startup_helper_win.cc',
29         '../content/public/common/content_switches.cc',
30       ],
31       'mac_bundle_resources': [
32         'app/app-Info.plist',
33       ],
34       # TODO(mark): Come up with a fancier way to do this.  It should only
35       # be necessary to list app-Info.plist once, not the three times it is
36       # listed here.
37       'mac_bundle_resources!': [
38         'app/app-Info.plist',
39       ],
40       'xcode_settings': {
41         'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves',
42         'INFOPLIST_FILE': 'app/app-Info.plist',
43       },
44       'conditions': [
45         ['use_aura==1 and use_webkit_compositor==0', {
46           'dependencies': [
47             '../ui/gfx/compositor/compositor.gyp:test_compositor',
48           ],
49         }],
50         ['OS == "android"', {
51           # Don't put the 'chrome' target in 'all' on android
52           'suppress_wildcard': 1,
53         }],
54         ['os_posix == 1 and OS != "mac"', {
55           'actions': [
56             {
57               'action_name': 'manpage',
58               'conditions': [
59                 [ 'branding == "Chrome"', {
60                   'variables': {
61                     'name': 'Google Chrome',
62                     'filename': 'google-chrome',
63                     'confdir': 'google-chrome',
64                   },
65                 }, { # else branding!="Chrome"
66                   'variables': {
67                     'name': 'Chromium',
68                     'filename': 'chromium-browser',
69                     'confdir': 'chromium',
70                   },
71                 }],
72               ],
73               'inputs': [
74                 'tools/build/linux/sed.sh',
75                 'app/resources/manpage.1.in',
76               ],
77               'outputs': [
78                 '<(PRODUCT_DIR)/chrome.1',
79               ],
80               'action': [
81                 'tools/build/linux/sed.sh',
82                 'app/resources/manpage.1.in',
83                 '<@(_outputs)',
84                 '-e', 's/@@NAME@@/<(name)/',
85                 '-e', 's/@@FILENAME@@/<(filename)/',
86                 '-e', 's/@@CONFDIR@@/<(confdir)/',
87               ],
88               'message': 'Generating manpage'
89             },
90           ],
91           'conditions': [
92             ['linux_use_tcmalloc==1', {
93                 'dependencies': [
94                   '<(allocator_target)',
95                 ],
96               },
97             ],
98             # TODO(rkc): Remove once crosbug.com/15266 is fixed.
99             ['profiling==1', {
100               'ldflags': ['-nopie'],
101             }, {
102               # Building with -pie needs investigating on ARM.
103               # For now, at least use it on Linux Intel.
104               'conditions': [
105                 ['(target_arch=="x64" or target_arch=="ia32") and linux_disable_pie!=1', {
106                   'ldflags': ['-pie'],
107                 }],
108               ],
109             }],
110             ['use_system_xdg_utils==0', {
111               'copies': [
112                 {
113                   'destination': '<(PRODUCT_DIR)',
114                   'files': ['tools/build/linux/chrome-wrapper',
115                             '../third_party/xdg-utils/scripts/xdg-mime',
116                             '../third_party/xdg-utils/scripts/xdg-settings',
117                             ],
118                   # The wrapper script above may need to generate a .desktop
119                   # file, which requires an icon. So, copy one next to the
120                   # script.
121                   'conditions': [
122                     ['branding=="Chrome"', {
123                       'files': ['app/theme/google_chrome/product_logo_48.png']
124                     }, { # else: 'branding!="Chrome"
125                       'files': ['app/theme/chromium/product_logo_48.png']
126                     }],
127                   ],
128                 },
129               ],
130             }],
131             ['toolkit_uses_gtk == 1', {
132               'dependencies': [
133                 # On Linux, link the dependencies (libraries) that make up actual
134                 # Chromium functionality directly into the executable.
135                 '<@(chromium_dependencies)',
136                 # Needed for chrome_main.cc initialization of libraries.
137                 '../build/linux/system.gyp:gtk',
138                 # Needed to use the master_preferences functions
139                 'installer_util',
140               ],
141             }, { # else toolkit_uses_gtk == 1
142               'dependencies': [
143                 # On Linux, link the dependencies (libraries) that make up actual
144                 # Chromium functionality directly into the executable.
145                 '<@(chromium_dependencies)',
146                 # Needed for chrome_main.cc initialization of libraries.
147                 '../build/linux/system.gyp:x11',
148                 '../build/linux/system.gyp:pangocairo',
149                 '../build/linux/system.gyp:xext',
150                 # Needed to use the master_preferences functions
151                 'installer_util',
152               ],
153             }],
154           ],
155           'sources': [
156             'app/chrome_dll_resource.h',
157             'app/chrome_main.cc',
158             'app/chrome_main_delegate.cc',
159             'app/chrome_main_delegate.h',
160           ],
161         }],
162         ['OS=="mac"', {
163           # 'branding' is a variable defined in common.gypi
164           # (e.g. "Chromium", "Chrome")
165           'conditions': [
166             ['branding=="Chrome"', {
167               'mac_bundle_resources': [
168                 'app/theme/google_chrome/app.icns',
169                 'app/theme/google_chrome/document.icns',
170                 'browser/ui/cocoa/applescript/scripting.sdef',
171               ],
172             }, {  # else: 'branding!="Chrome"
173               'mac_bundle_resources': [
174                 'app/theme/chromium/app.icns',
175                 'app/theme/chromium/document.icns',
176                 'browser/ui/cocoa/applescript/scripting.sdef',
177               ],
178             }],
179             ['mac_breakpad==1', {
180               'variables': {
181                 # A real .dSYM is needed for dump_syms to operate on.
182                 'mac_real_dsym': 1,
183               },
184               'xcode_settings': {
185                 # With mac_real_dsym set, strip_from_xcode won't be used.
186                 # Specify CHROMIUM_STRIP_SAVE_FILE directly to Xcode.
187                 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
188               },
189               'dependencies': [
190                 '../breakpad/breakpad.gyp:dump_syms',
191                 '../breakpad/breakpad.gyp:symupload',
193                 # In order to process symbols for the Remoting Host plugin,
194                 # that plugin needs to be built beforehand.  Since the
195                 # "Dump Symbols" step hangs off this target, that plugin also
196                 # needs to be added as a dependency.
197                 '../remoting/remoting.gyp:remoting_host_plugin',
198               ],
199               # The "Dump Symbols" post-build step is in a target_conditions
200               # block so that it will follow the "Strip If Needed" step if that
201               # is also being used.  There is no standard configuration where
202               # both of these steps occur together, but Mark likes to use this
203               # configuration sometimes when testing Breakpad-enabled builds
204               # without the time overhead of creating real .dSYM files.  When
205               # both "Dump Symbols" and "Strip If Needed" are present, "Dump
206               # Symbols" must come second because "Strip If Needed" creates
207               # a fake .dSYM that dump_syms needs to fake dump.  Since
208               # "Strip If Needed" is added in a target_conditions block in
209               # common.gypi, "Dump Symbols" needs to be in an (always true)
210               # target_conditions block.
211               'target_conditions': [
212                 ['1 == 1', {
213                   'postbuilds': [
214                     {
215                       'postbuild_name': 'Dump Symbols',
216                       'variables': {
217                         'dump_product_syms_path':
218                             'tools/build/mac/dump_product_syms',
219                       },
220                       'action': ['<(dump_product_syms_path)',
221                                  '<(branding)'],
222                     },
223                   ],
224                 }],
225               ],
226             }],  # mac_breakpad
227           ],
228           'product_name': '<(mac_product_name)',
229           'xcode_settings': {
230             # chrome/app/app-Info.plist has:
231             #   CFBundleIdentifier of CHROMIUM_BUNDLE_ID
232             #   CFBundleName of CHROMIUM_SHORT_NAME
233             #   CFBundleSignature of CHROMIUM_CREATOR
234             # Xcode then replaces these values with the branded values we set
235             # as settings on the target.
236             'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
237             'CHROMIUM_CREATOR': '<(mac_creator)',
238             'CHROMIUM_SHORT_NAME': '<(branding)',
239           },
240           'dependencies': [
241             'helper_app',
242             'infoplist_strings_tool',
243             'interpose_dependency_shim',
244             'chrome_manifest_bundle',
245           ],
246           'mac_bundle_resources': [
247             '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
248           ],
249           'actions': [
250             {
251               # Generate the InfoPlist.strings file
252               'action_name': 'Generate InfoPlist.strings files',
253               'variables': {
254                 'tool_path': '<(PRODUCT_DIR)/infoplist_strings_tool',
255                 # Unique dir to write to so the [lang].lproj/InfoPlist.strings
256                 # for the main app and the helper app don't name collide.
257                 'output_path': '<(INTERMEDIATE_DIR)/app_infoplist_strings',
258               },
259               'conditions': [
260                 [ 'branding == "Chrome"', {
261                   'variables': {
262                      'branding_name': 'google_chrome_strings',
263                   },
264                 }, { # else branding!="Chrome"
265                   'variables': {
266                      'branding_name': 'chromium_strings',
267                   },
268                 }],
269               ],
270               'inputs': [
271                 '<(tool_path)',
272                 '<(version_path)',
273                 # TODO: remove this helper when we have loops in GYP
274                 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
275               ],
276               'outputs': [
277                 # TODO: remove this helper when we have loops in GYP
278                 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
279               ],
280               'action': [
281                 '<(tool_path)',
282                 '-b', '<(branding_name)',
283                 '-v', '<(version_path)',
284                 '-g', '<(grit_out_dir)',
285                 '-o', '<(output_path)',
286                 '-t', 'main',
287                 '<@(locales)',
288               ],
289               'message': 'Generating the language InfoPlist.strings files',
290               'process_outputs_as_mac_bundle_resources': 1,
291             },
292           ],
293           'copies': [
294             {
295               'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
296               'files': [
297                 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
298                 '<(PRODUCT_DIR)/libplugin_carbon_interpose.dylib',
299               ],
300             },
301           ],
302           'postbuilds': [
303             {
304               'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
305               'action': [
306                 'tools/build/mac/copy_framework_unversioned',
307                 '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Framework.framework',
308                 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Versions/<(version_full)',
309               ],
310             },
311             {
312               # Modify the Info.plist as needed.  The script explains why this
313               # is needed.  This is also done in the helper_app and chrome_dll
314               # targets.  Use -b0 to not include any Breakpad information; that
315               # all goes into the framework's Info.plist.  Keystone information
316               # is included if Keystone is enabled.  The application reads
317               # Keystone keys from this plist and not the framework's, and
318               # the ticket will reference this Info.plist to determine the tag
319               # of the installed product.  Use -s1 to include Subversion
320               # information.  The -p flag controls whether to insert PDF as a
321               # supported type identifier that can be opened.
322               'postbuild_name': 'Tweak Info.plist',
323               'action': ['<(tweak_info_plist_path)',
324                          '-b0',
325                          '-k<(mac_keystone)',
326                          '-s1',
327                          '-p<(internal_pdf)',
328                          '<(branding)',
329                          '<(mac_bundle_id)'],
330             },
331             {
332               'postbuild_name': 'Clean up old versions',
333               'action': [
334                 'tools/build/mac/clean_up_old_versions',
335                 '<(version_full)'
336               ],
337             },
338             {
339               # This postbuid step is responsible for creating the following
340               # helpers:
341               #
342               # For unofficial Chromium branding, Chromium Helper EH.app and
343               # Chromium Helper NP.app are created from Chromium Helper.app.
344               # For official Google Chrome branding, Google Chrome Helper
345               # EH.app and Google Chrome Helper NP.app are created from
346               # Google Chrome Helper.app.
347               #
348               # The EH helper is marked for an executable heap. The NP helper
349               # is marked for no PIE (ASLR).
350               #
351               # Normally, applications shipping as part of offical builds with
352               # Google Chrome branding have dsymutil (dwarf-with-dsym,
353               # mac_real_dsym) and dump_syms (mac_breakpad) run on them to
354               # produce a .dSYM bundle and a Breakpad .sym file. This is
355               # unnecessary for the "More Helpers" because they're identical
356               # to the original helper except for the bits in their Mach-O
357               # headers that change to enable or disable special features.
358               # Each .dSYM is identified by UUID stored in a Mach-O file's
359               # LC_UUID load command. Because the "More Helpers" share a UUID
360               # with the original helper, there's no need to run dsymutil
361               # again. All helpers can share the same .dSYM. Special handling
362               # is performed in chrome/tools/build/mac/dump_product_syms to
363               # prepare their Breakpad symbol files.
364               'postbuild_name': 'Make More Helpers',
365               'action': [
366                 'tools/build/mac/make_more_helpers.sh',
367                 '<(version_full)',
368                 '<(mac_product_name)',
369               ],
370             },
371             {
372               # Make sure there isn't any Objective-C in the browser app's
373               # executable.
374               'postbuild_name': 'Verify No Objective-C',
375               'action': [
376                 'tools/build/mac/verify_no_objc.sh',
377               ],
378             },
379           ],  # postbuilds
380         }],
381         ['OS=="linux"', {
382           'conditions': [
383             ['branding=="Chrome"', {
384               'dependencies': [
385                 'linux_installer_configs',
386               ],
387             }],
388             ['selinux==0', {
389               'dependencies': [
390                 '../sandbox/sandbox.gyp:sandbox',
391               ],
392             }],
393           ],
394         }],
395         ['OS != "mac"', {
396           'conditions': [
397             # TODO:  add a:
398             #   'product_name': 'chromium'
399             # whenever we convert the rest of the infrastructure
400             # (buildbots etc.) to understand the branding gyp define.
401             # NOTE: chrome/app/theme/chromium/BRANDING and
402             # chrome/app/theme/google_chrome/BRANDING have the short name
403             # "chrome" etc.; should we try to extract from there instead?
405             # On Mac, this is done in chrome_dll.gypi.
406             ['internal_pdf', {
407               'dependencies': [
408                 '../pdf/pdf.gyp:pdf',
409               ],
410             }],
411           ],
412           'dependencies': [
413             'chrome_resources.gyp:packed_extra_resources',
414             'chrome_resources.gyp:packed_resources',
415             # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp
416             # file decide what to do on a per-OS basis; on Mac, internal plugins
417             # go inside the framework, so this dependency is in chrome_dll.gypi.
418             '../third_party/adobe/flash/flash_player.gyp:flash_player',
419           ],
420         }],
421         ['OS=="linux"', {
422           'conditions': [
423             # For now, do not build nacl_helper when disable_nacl=1
424             ['disable_nacl!=1', {
425               'dependencies': [
426                 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
427                 'nacl_helper',
428                 ],
429             }],
430           ],
431         }],
432         ['OS=="mac"', {
433           'dependencies': [
434             # On Mac, make sure we've built chrome_dll, which contains all of
435             # the library code with Chromium functionality.
436             'chrome_dll',
437           ],
438         }],
439         ['OS=="mac" and asan==1', {
440           'xcode_settings': {
441             # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
442             'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
443           },
444         }],
445         ['OS=="win"', {
446           'dependencies': [
447             'chrome_dll',
448             'chrome_version_resources',
449             'installer_util',
450             'installer_util_strings',
451             '../base/base.gyp:base',
452             '../breakpad/breakpad.gyp:breakpad_handler',
453             '../breakpad/breakpad.gyp:breakpad_sender',
454             '../sandbox/sandbox.gyp:sandbox',
455             'app/policy/cloud_policy_codegen.gyp:policy',
456           ],
457           'sources': [
458             'app/chrome_exe.rc',
459             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
460           ],
461           'msvs_settings': {
462             'VCLinkerTool': {
463               'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
464               'ProgramDatabaseFile': '$(OutDir)\\chrome_exe.pdb',
465               'DelayLoadDLLs': [
466                 'dbghelp.dll',
467                 'dwmapi.dll',
468                 'uxtheme.dll',
469                 'ole32.dll',
470                 'oleaut32.dll',
471               ],
472               # Set /SUBSYSTEM:WINDOWS for chrome.exe itself.
473               'SubSystem': '2',
474             },
475             'VCManifestTool': {
476               'AdditionalManifestFiles': '$(ProjectDir)\\app\\chrome.exe.manifest',
477             },
478           },
479           'actions': [
480             {
481               'action_name': 'first_run',
482               'inputs': [
483                   'app/FirstRun',
484               ],
485               'outputs': [
486                   '<(PRODUCT_DIR)/First Run',
487               ],
488               'action': ['cp', '-f', '<@(_inputs)', '<@(_outputs)'],
489               'message': 'Copy first run complete sentinel file',
490             },
491           ],
492         }, {  # 'OS!="win"
493           'sources!': [
494             'app/client_util.cc',
495           ],
496         }],
497         ['OS=="win" and component=="shared_library"', {
498           'defines': ['COMPILE_CONTENT_STATICALLY'],
499         }]
500       ],
501     },
502   ],
503   'conditions': [
504     ['OS=="win"', {
505       'targets': [
506         {
507           'target_name': 'chrome_nacl_win64',
508           'type': 'executable',
509           'product_name': 'nacl64',
510           'sources': [
511             'app/breakpad_win.cc',
512             'app/hard_error_handler_win.cc',
513             'nacl/nacl_exe_win_64.cc',
514             '../content/app/startup_helper_win.cc',
515             '../content/common/debug_flags.cc',  # Needed for sandbox_policy.cc
516             '../content/common/hi_res_timer_manager_win.cc',
517             '../content/common/sandbox_init_win.cc',
518             '../content/common/sandbox_policy.cc',
519             '../content/public/common/content_switches.cc',
520             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/nacl64_exe_version.rc',
521           ],
522           'dependencies': [
523             'app/policy/cloud_policy_codegen.gyp:policy_win64',
524             'chrome_version_resources',
525             'common_constants_win64',
526             'installer_util_nacl_win64',
527             'nacl_win64',
528             '../breakpad/breakpad.gyp:breakpad_handler_win64',
529             '../breakpad/breakpad.gyp:breakpad_sender_win64',
530             '../base/base.gyp:base_i18n_nacl_win64',
531             '../base/base.gyp:base_nacl_win64',
532             '../base/base.gyp:base_static_win64',
533             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
534             '../ipc/ipc.gyp:ipc_win64',
535             '../sandbox/sandbox.gyp:sandbox_win64',
536           ],
537           'defines': [
538             '<@(nacl_win64_defines)',
539             'COMPILE_CONTENT_STATICALLY',
540           ],
541           'include_dirs': [
542             '<(SHARED_INTERMEDIATE_DIR)/chrome',
543           ],
544           'msvs_settings': {
545             'VCLinkerTool': {
546               'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
547               'ProgramDatabaseFile': '$(OutDir)\\nacl64_exe.pdb',
548               'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
549             },
550           },
551           'configurations': {
552             'Common_Base': {
553               'msvs_target_platform': 'x64',
554             },
555           },
556         },
557       ],
558     }],
559   ],