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