Change the separator of the keyboard overlay data to allow labels containing spaces.
[chromium-blink-merge.git] / chrome / chrome_exe.gypi
blob9d22d11217b277b0d748c68f806df5699f82388c
1 # Copyright (c) 2010 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   'target_defaults': {
7     'variables': {
8       'chrome_exe_target': 0,
9     },
10     'target_conditions': [
11       ['chrome_exe_target==1', {
12         'sources': [
13           # .cc, .h, and .mm files under app that are used on all
14           # platforms, including both 32-bit and 64-bit Windows.
15           # Test files are not included.
16           'app/breakpad_win.cc',
17           'app/breakpad_win.h',
18           'app/chrome_exe_main_gtk.cc',
19           'app/chrome_exe_main_mac.mm',
20           'app/chrome_exe_main_win.cc',
21           'app/chrome_exe_resource.h',
22           'app/client_util.cc',
23           'app/client_util.h',
24           'app/hard_error_handler_win.cc',
25           'app/hard_error_handler_win.h',
26           'app/scoped_ole_initializer.h',
27           # TODO(bradnelson): once automatic generation of 64 bit targets on
28           # Windows is ready, take this out and add a dependency on
29           # content_common.gypi.
30           '../content/common/content_switches.cc',
31           '../content/common/content_switches.h',
32         ],
33         'mac_bundle_resources': [
34           'app/app-Info.plist',
35         ],
36         # TODO(mark): Come up with a fancier way to do this.  It should only
37         # be necessary to list app-Info.plist once, not the three times it is
38         # listed here.
39         'mac_bundle_resources!': [
40           'app/app-Info.plist',
41         ],
42         'xcode_settings': {
43           'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves',
44           'INFOPLIST_FILE': 'app/app-Info.plist',
45         },
46         'conditions': [
47           ['OS=="win"', {
48             'sources': [
49               'app/chrome_exe.rc',
50               'app/chrome_exe_version.rc.version',
51             ],
52             'include_dirs': [
53               '<(SHARED_INTERMEDIATE_DIR)/chrome',
54             ],
55             # TODO(scottbyer): This is a temporary workaround.  The right fix
56             # is to change the output file to be in $(IntDir) for this project
57             # and the .dll project and use the hardlink script to link it back
58             # to $(OutDir).
59             'configurations': {
60               'Debug_Base': {
61                 'msvs_settings': {
62                   'VCLinkerTool': {
63                     'LinkIncremental': '1',
64                   },
65                 },
66               },
67             },
68             'msvs_settings': {
69               'VCLinkerTool': {
70                 'DelayLoadDLLs': [
71                   'dbghelp.dll',
72                   'dwmapi.dll',
73                   'uxtheme.dll',
74                   'ole32.dll',
75                   'oleaut32.dll',
76                 ],
77                 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself.
78                 'SubSystem': '2',
79               },
80               'VCManifestTool': {
81                 'AdditionalManifestFiles': '$(ProjectDir)\\app\\chrome.exe.manifest',
82               },
83             },
84             'actions': [
85               {
86                 'action_name': 'version',
87                 'variables': {
88                   'template_input_path': 'app/chrome_exe_version.rc.version',
89                 },
90                 'conditions': [
91                   [ 'branding == "Chrome"', {
92                     'variables': {
93                        'branding_path': 'app/theme/google_chrome/BRANDING',
94                     },
95                   }, { # else branding!="Chrome"
96                     'variables': {
97                        'branding_path': 'app/theme/chromium/BRANDING',
98                     },
99                   }],
100                 ],
101                 'inputs': [
102                   '<(template_input_path)',
103                   '<(version_path)',
104                   '<(branding_path)',
105                 ],
106                 'outputs': [
107                   '<(SHARED_INTERMEDIATE_DIR)/chrome/chrome_exe_version.rc',
108                 ],
109                 'action': [
110                   'python',
111                   '<(version_py_path)',
112                   '-f', '<(version_path)',
113                   '-f', '<(branding_path)',
114                   '<(template_input_path)',
115                   '<@(_outputs)',
116                 ],
117                 'process_outputs_as_sources': 1,
118                 'message': 'Generating version information in <(_outputs)'
119               },
120               {
121                 'action_name': 'first_run',
122                 'inputs': [
123                     'app/FirstRun',
124                 ],
125                 'outputs': [
126                     '<(PRODUCT_DIR)/First Run',
127                 ],
128                 'action': ['cp', '-f', '<@(_inputs)', '<@(_outputs)'],
129                 'message': 'Copy first run complete sentinel file',
130               },
131             ],
132           }, {  # 'OS!="win"
133             'sources!': [
134               'app/client_util.cc',
135             ]
136           }],
137         ],
138       }],
139     ],
140   },
141   'targets': [
142     {
143       'target_name': 'chrome',
144       'type': 'executable',
145       'mac_bundle': 1,
146       'msvs_guid': '7B219FAA-E360-43C8-B341-804A94EEFFAC',
147       'variables': {
148         'chrome_exe_target': 1,
149         'use_system_xdg_utils%': 0,
150       },
151       'conditions': [
152         ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
153           'actions': [
154             {
155               'action_name': 'manpage',
156               'conditions': [
157                 [ 'branding == "Chrome"', {
158                   'variables': {
159                     'name': 'Google Chrome',
160                     'filename': 'google-chrome',
161                     'confdir': 'google-chrome',
162                   },
163                 }, { # else branding!="Chrome"
164                   'variables': {
165                     'name': 'Chromium',
166                     'filename': 'chromium-browser',
167                     'confdir': 'chromium',
168                   },
169                 }],
170               ],
171               'inputs': [
172                 'tools/build/linux/sed.sh',
173                 'app/resources/manpage.1.in',
174               ],
175               'outputs': [
176                 '<(PRODUCT_DIR)/chrome.1',
177               ],
178               'action': [
179                 'tools/build/linux/sed.sh',
180                 'app/resources/manpage.1.in',
181                 '<@(_outputs)',
182                 '-e', 's/@@NAME@@/<(name)/',
183                 '-e', 's/@@FILENAME@@/<(filename)/',
184                 '-e', 's/@@CONFDIR@@/<(confdir)/',
185               ],
186               'message': 'Generating manpage'
187             },
188           ],
189           'conditions': [
190             [ 'linux_use_tcmalloc==1', {
191                 'dependencies': [
192                   '<(allocator_target)',
193                 ],
194               },
195             ],
196             ['use_system_xdg_utils==0', {
197               'copies': [
198                 {
199                   'destination': '<(PRODUCT_DIR)',
200                   'files': ['tools/build/linux/chrome-wrapper',
201                             '../third_party/xdg-utils/scripts/xdg-mime',
202                             '../third_party/xdg-utils/scripts/xdg-settings',
203                             ],
204                   # The wrapper script above may need to generate a .desktop
205                   # file, which requires an icon. So, copy one next to the
206                   # script.
207                   'conditions': [
208                     ['branding=="Chrome"', {
209                       'files': ['app/theme/google_chrome/product_logo_48.png']
210                     }, { # else: 'branding!="Chrome"
211                       'files': ['app/theme/chromium/product_logo_48.png']
212                     }],
213                   ],
214                 },
215               ],
216             }],
217           ],
218           'dependencies': [
219             # On Linux, link the dependencies (libraries) that make up actual
220             # Chromium functionality directly into the executable.
221             '<@(chromium_dependencies)',
222             # Needed for chrome_main.cc initialization of libraries.
223             '../build/linux/system.gyp:dbus-glib',
224             '../build/linux/system.gyp:gtk',
225             'packed_resources',
226             # Needed to use the master_preferences functions
227             'installer_util',
228           ],
229           'sources': [
230             'app/chrome_dll_resource.h',
231             'app/chrome_main.cc',
232             'app/chrome_main_posix.cc',
233           ],
234         }],
235         ['OS=="mac"', {
236           # 'branding' is a variable defined in common.gypi
237           # (e.g. "Chromium", "Chrome")
238           'conditions': [
239             ['branding=="Chrome"', {
240               'mac_bundle_resources': [
241                 'app/theme/google_chrome/app.icns',
242                 'app/theme/google_chrome/document.icns',
243                 'browser/ui/cocoa/applescript/scripting.sdef',
244               ],
245             }, {  # else: 'branding!="Chrome"
246               'mac_bundle_resources': [
247                 'app/theme/chromium/app.icns',
248                 'app/theme/chromium/document.icns',
249                 'browser/ui/cocoa/applescript/scripting.sdef',
250               ],
251             }],
252             ['mac_breakpad==1', {
253               'variables': {
254                 # A real .dSYM is needed for dump_syms to operate on.
255                 'mac_real_dsym': 1,
256               },
257               'dependencies': [
258                 '../breakpad/breakpad.gyp:dump_syms',
259                 '../breakpad/breakpad.gyp:symupload',
260               ],
261               # The "Dump Symbols" post-build step is in a target_conditions
262               # block so that it will follow the "Strip If Needed" step if that
263               # is also being used.  There is no standard configuration where
264               # both of these steps occur together, but Mark likes to use this
265               # configuraiton sometimes when testing Breakpad-enabled builds
266               # without the time overhead of creating real .dSYM files.  When
267               # both "Dump Symbols" and "Strip If Needed" are present, "Dump
268               # Symbols" must come second because "Strip If Needed" creates
269               # a fake .dSYM that dump_syms needs to fake dump.  Since
270               # "Strip If Needed" is added in a target_conditions block in
271               # common.gypi, "Dump Symbols" needs to be in an (always true)
272               # target_conditions block.
273               'target_conditions': [
274                 ['1 == 1', {
275                   'postbuilds': [
276                     {
277                       'postbuild_name': 'Dump Symbols',
278                       'variables': {
279                         'dump_product_syms_path':
280                             'tools/build/mac/dump_product_syms',
281                       },
282                       'action': ['<(dump_product_syms_path)',
283                                  '<(branding)'],
284                     },
285                   ],
286                 }],
287               ],
288             }],  # mac_breakpad
289           ],
290           'product_name': '<(mac_product_name)',
291           'xcode_settings': {
292             # chrome/app/app-Info.plist has:
293             #   CFBundleIdentifier of CHROMIUM_BUNDLE_ID
294             #   CFBundleName of CHROMIUM_SHORT_NAME
295             #   CFBundleSignature of CHROMIUM_CREATOR
296             # Xcode then replaces these values with the branded values we set
297             # as settings on the target.
298             'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
299             'CHROMIUM_CREATOR': '<(mac_creator)',
300             'CHROMIUM_SHORT_NAME': '<(branding)',
301           },
302           'dependencies': [
303             'helper_app',
304             'infoplist_strings_tool',
305             'chrome_manifest_bundle',
306           ],
307           'mac_bundle_resources': [
308             '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
309           ],
310           'actions': [
311             {
312               # Generate the InfoPlist.strings file
313               'action_name': 'Generate InfoPlist.strings files',
314               'variables': {
315                 'tool_path': '<(PRODUCT_DIR)/infoplist_strings_tool',
316                 # Unique dir to write to so the [lang].lproj/InfoPlist.strings
317                 # for the main app and the helper app don't name collide.
318                 'output_path': '<(INTERMEDIATE_DIR)/app_infoplist_strings',
319               },
320               'conditions': [
321                 [ 'branding == "Chrome"', {
322                   'variables': {
323                      'branding_name': 'google_chrome_strings',
324                   },
325                 }, { # else branding!="Chrome"
326                   'variables': {
327                      'branding_name': 'chromium_strings',
328                   },
329                 }],
330               ],
331               'inputs': [
332                 '<(tool_path)',
333                 '<(version_path)',
334                 # TODO: remove this helper when we have loops in GYP
335                 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
336               ],
337               'outputs': [
338                 # TODO: remove this helper when we have loops in GYP
339                 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
340               ],
341               'action': [
342                 '<(tool_path)',
343                 '-b', '<(branding_name)',
344                 '-v', '<(version_path)',
345                 '-g', '<(grit_out_dir)',
346                 '-o', '<(output_path)',
347                 '-t', 'main',
348                 '<@(locales)',
349               ],
350               'message': 'Generating the language InfoPlist.strings files',
351               'process_outputs_as_mac_bundle_resources': 1,
352             },
353           ],
354           'copies': [
355             {
356               'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
357               'files': [
358                 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
359               ],
360             },
361           ],
362           'postbuilds': [
363             {
364               'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
365               'action': [
366                 'tools/build/mac/copy_framework_unversioned',
367                 '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Framework.framework',
368                 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Versions/<(version_full)',
369               ],
370             },
371             {
372               # Modify the Info.plist as needed.  The script explains why this
373               # is needed.  This is also done in the helper_app and chrome_dll
374               # targets.  Use -b0 to not include any Breakpad information; that
375               # all goes into the framework's Info.plist.  Keystone information
376               # is included if Keystone is enabled.  The application reads
377               # Keystone keys from this plist and not the framework's, and
378               # the ticket will reference this Info.plist to determine the tag
379               # of the installed product.  Use -s1 to include Subversion
380               # information.
381               'postbuild_name': 'Tweak Info.plist',
382               'action': ['<(tweak_info_plist_path)',
383                          '-b0',
384                          '-k<(mac_keystone)',
385                          '-s1',
386                          '<(branding)',
387                          '<(mac_bundle_id)'],
388             },
389             {
390               'postbuild_name': 'Clean up old versions',
391               'action': [
392                 'tools/build/mac/clean_up_old_versions',
393                 '<(version_full)'
394               ],
395             },
396           ],  # postbuilds
397         }],
398         ['OS=="linux"', {
399           'conditions': [
400             ['branding=="Chrome"', {
401               'dependencies': [
402                 'linux_installer_configs',
403               ],
404             }],
405             ['selinux==0', {
406               'dependencies': [
407                 '../sandbox/sandbox.gyp:sandbox',
408               ],
409             }],
410           ],
411         }],
412         ['OS != "mac"', {
413           'conditions': [
414             ['branding=="Chrome"', {
415               'product_name': 'chrome'
416             }, {  # else: Branding!="Chrome"
417               # TODO:  change to:
418               #   'product_name': 'chromium'
419               # whenever we convert the rest of the infrastructure
420               # (buildbots etc.) to use "gyp -Dbranding=Chrome".
421               # NOTE: chrome/app/theme/chromium/BRANDING and
422               # chrome/app/theme/google_chrome/BRANDING have the short names,
423               # etc.; should we try to extract from there instead?
424               'product_name': 'chrome'
425             }],
426             # On Mac, this is done in chrome_dll.gypi.
427             ['internal_pdf', {
428               'dependencies': [
429                 '../pdf/pdf.gyp:pdf',
430               ],
431             }],
432           ],
433           'dependencies': [
434             'packed_extra_resources',
435             # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp
436             # file decide what to do on a per-OS basis; on Mac, internal plugins
437             # go inside the framework, so this dependency is in chrome_dll.gypi.
438             '../third_party/adobe/flash/flash_player.gyp:flash_player',
439           ],
440         }],
441         ['OS=="mac" or OS=="win"', {
442           'dependencies': [
443             # On Windows and Mac, make sure we've built chrome_dll, which
444             # contains all of the library code with Chromium functionality.
445             'chrome_dll',
446           ],
447         }],
448         ['OS=="win"', {
449           'dependencies': [
450             'installer_util',
451             'installer_util_strings',
452             '../breakpad/breakpad.gyp:breakpad_handler',
453             '../breakpad/breakpad.gyp:breakpad_sender',
454             '../sandbox/sandbox.gyp:sandbox',
455             'app/locales/locales.gyp:*',
456             'app/policy/cloud_policy_codegen.gyp:policy',
457           ],
458           'msvs_settings': {
459             'VCLinkerTool': {
460               'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
461               'ProgramDatabaseFile': '$(OutDir)\\chrome_exe.pdb',
462             },
463           },
464         }],
465       ],
466     },
467     {
468       'target_name': 'chrome_mesa',
469       'type': 'none',
470       'dependencies': [
471         'chrome',
472         '../third_party/mesa/mesa.gyp:osmesa',
473       ],
474       'conditions': [
475         ['OS=="mac"', {
476           'copies': [{
477             'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)/<(mac_product_name) Helper.app/Contents/MacOS/',
478             'files': ['<(PRODUCT_DIR)/osmesa.so'],
479           }],
480         }],
481       ],
482     },
483   ],
484   'conditions': [
485     ['OS=="win"', {
486       'targets': [
487         {
488           'target_name': 'chrome_nacl_win64',
489           'type': 'executable',
490           'product_name': 'nacl64',
491           'msvs_guid': 'BB1AE956-038B-4092-96A2-951D2B418548',
492           'variables': {
493             'chrome_exe_target': 1,
494           },
495           'dependencies': [
496             # On Windows make sure we've built Win64 version of chrome_dll,
497             # which contains all of the library code with Chromium
498             # functionality.
499             'chrome_dll_nacl_win64',
500             'common_constants_win64',
501             'installer_util_nacl_win64',
502             'app/policy/cloud_policy_codegen.gyp:policy_win64',
503             '../breakpad/breakpad.gyp:breakpad_handler_win64',
504             '../breakpad/breakpad.gyp:breakpad_sender_win64',
505             '../base/base.gyp:base_nacl_win64',
506             '../chrome_frame/chrome_frame.gyp:npchrome_frame',
507             '../sandbox/sandbox.gyp:sandbox_win64',
508           ],
509           'defines': [
510             '<@(nacl_win64_defines)',
511           ],
512           'include_dirs': [
513             '<(SHARED_INTERMEDIATE_DIR)/chrome',
514           ],
515           'msvs_settings': {
516             'VCLinkerTool': {
517               'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
518               'ProgramDatabaseFile': '$(OutDir)\\nacl64_exe.pdb',
519             },
520           },
521           'configurations': {
522             'Common_Base': {
523               'msvs_target_platform': 'x64',
524             },
525           },
526         },
527       ],
528     }],
529   ],