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