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.
8 'target_name': 'chrome',
12 'use_system_xdg_utils%': 0,
13 'enable_wexit_time_destructors': 1,
16 'app/breakpad_win.cc',
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',
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',
31 'mac_bundle_resources': [
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
37 'mac_bundle_resources!': [
41 'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves',
42 'INFOPLIST_FILE': 'app/app-Info.plist',
45 ['use_aura==1 and use_webkit_compositor==0', {
47 '../ui/gfx/compositor/compositor.gyp:test_compositor',
51 # Don't put the 'chrome' target in 'all' on android
52 'suppress_wildcard': 1,
54 ['os_posix == 1 and OS != "mac"', {
57 'action_name': 'manpage',
59 [ 'branding == "Chrome"', {
61 'name': 'Google Chrome',
62 'filename': 'google-chrome',
63 'confdir': 'google-chrome',
65 }, { # else branding!="Chrome"
68 'filename': 'chromium-browser',
69 'confdir': 'chromium',
74 'tools/build/linux/sed.sh',
75 'app/resources/manpage.1.in',
78 '<(PRODUCT_DIR)/chrome.1',
81 'tools/build/linux/sed.sh',
82 'app/resources/manpage.1.in',
84 '-e', 's/@@NAME@@/<(name)/',
85 '-e', 's/@@FILENAME@@/<(filename)/',
86 '-e', 's/@@CONFDIR@@/<(confdir)/',
88 'message': 'Generating manpage'
92 ['linux_use_tcmalloc==1', {
94 '<(allocator_target)',
98 # TODO(rkc): Remove once crosbug.com/15266 is fixed.
100 'ldflags': ['-nopie'],
102 # Building with -pie needs investigating on ARM.
103 # For now, at least use it on Linux Intel.
105 ['(target_arch=="x64" or target_arch=="ia32") and linux_disable_pie!=1', {
110 ['use_system_xdg_utils==0', {
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',
118 # The wrapper script above may need to generate a .desktop
119 # file, which requires an icon. So, copy one next to the
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']
131 ['toolkit_uses_gtk == 1', {
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
141 }, { # else toolkit_uses_gtk == 1
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
156 'app/chrome_dll_resource.h',
157 'app/chrome_main.cc',
158 'app/chrome_main_delegate.cc',
159 'app/chrome_main_delegate.h',
163 # 'branding' is a variable defined in common.gypi
164 # (e.g. "Chromium", "Chrome")
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',
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',
179 ['mac_breakpad==1', {
181 # A real .dSYM is needed for dump_syms to operate on.
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)',
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',
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': [
215 'postbuild_name': 'Dump Symbols',
217 'dump_product_syms_path':
218 'tools/build/mac/dump_product_syms',
220 'action': ['<(dump_product_syms_path)',
228 'product_name': '<(mac_product_name)',
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)',
242 'infoplist_strings_tool',
243 'interpose_dependency_shim',
244 'chrome_manifest_bundle',
246 'mac_bundle_resources': [
247 '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
251 # Generate the InfoPlist.strings file
252 'action_name': 'Generate InfoPlist.strings files',
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',
260 [ 'branding == "Chrome"', {
262 'branding_name': 'google_chrome_strings',
264 }, { # else branding!="Chrome"
266 'branding_name': 'chromium_strings',
273 # TODO: remove this helper when we have loops in GYP
274 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
277 # TODO: remove this helper when we have loops in GYP
278 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
282 '-b', '<(branding_name)',
283 '-v', '<(version_path)',
284 '-g', '<(grit_out_dir)',
285 '-o', '<(output_path)',
289 'message': 'Generating the language InfoPlist.strings files',
290 'process_outputs_as_mac_bundle_resources': 1,
295 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
297 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
298 '<(PRODUCT_DIR)/libplugin_carbon_interpose.dylib',
304 'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
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)',
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)',
332 'postbuild_name': 'Clean up old versions',
334 'tools/build/mac/clean_up_old_versions',
339 # This postbuid step is responsible for creating the following
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.
348 # The EH helper is marked for an executable heap. The NP helper
349 # is marked for no PIE (ASLR).
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',
366 'tools/build/mac/make_more_helpers.sh',
368 '<(mac_product_name)',
372 # Make sure there isn't any Objective-C in the browser app's
374 'postbuild_name': 'Verify No Objective-C',
376 'tools/build/mac/verify_no_objc.sh',
383 ['branding=="Chrome"', {
385 'linux_installer_configs',
390 '../sandbox/sandbox.gyp:sandbox',
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.
408 '../pdf/pdf.gyp:pdf',
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',
423 # For now, do not build nacl_helper when disable_nacl=1
424 ['disable_nacl!=1', {
426 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
434 # On Mac, make sure we've built chrome_dll, which contains all of
435 # the library code with Chromium functionality.
439 ['OS=="mac" and asan==1', {
441 # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
442 'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
448 'chrome_version_resources',
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',
459 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
463 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
464 'ProgramDatabaseFile': '$(OutDir)\\chrome_exe.pdb',
472 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself.
476 'AdditionalManifestFiles': '$(ProjectDir)\\app\\chrome.exe.manifest',
481 'action_name': 'first_run',
486 '<(PRODUCT_DIR)/First Run',
488 'action': ['cp', '-f', '<@(_inputs)', '<@(_outputs)'],
489 'message': 'Copy first run complete sentinel file',
494 'app/client_util.cc',
497 ['OS=="win" and component=="shared_library"', {
498 'defines': ['COMPILE_CONTENT_STATICALLY'],
507 'target_name': 'chrome_nacl_win64',
508 'type': 'executable',
509 'product_name': 'nacl64',
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',
523 'app/policy/cloud_policy_codegen.gyp:policy_win64',
524 'chrome_version_resources',
525 'common_constants_win64',
526 'installer_util_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',
538 '<@(nacl_win64_defines)',
539 'COMPILE_CONTENT_STATICALLY',
542 '<(SHARED_INTERMEDIATE_DIR)/chrome',
546 'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
547 'ProgramDatabaseFile': '$(OutDir)\\nacl64_exe.pdb',
548 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
553 'msvs_target_platform': 'x64',