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.
8 'target_name': 'chrome',
12 'use_system_xdg_utils%': 0,
13 'enable_wexit_time_destructors': 1,
16 'app/breakpad_field_trial_win.cc',
17 'app/breakpad_field_trial_win.h',
18 'app/breakpad_win.cc',
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',
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',
35 'mac_bundle_resources': [
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
41 'mac_bundle_resources!': [
45 'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves',
46 'INFOPLIST_FILE': 'app/app-Info.plist',
49 ['component == "shared_library"', {
52 'EmbedManifest': 'false',
56 ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
58 '../tools/cygprofile/cygprofile.gyp:cygprofile',
61 ['order_text_section!=""', {
62 'target_conditions' : [
63 ['_toolset=="target"', {
65 '-Wl,-section-ordering-file=<(order_text_section)' ],
70 # Don't put the 'chrome' target in 'all' on android
71 'suppress_wildcard': 1,
73 ['os_posix == 1 and OS != "mac" and OS != "android"', {
76 'action_name': 'manpage',
78 [ 'branding == "Chrome"', {
80 'name': 'Google Chrome',
81 'filename': 'google-chrome',
82 'confdir': 'google-chrome',
84 }, { # else branding!="Chrome"
87 'filename': 'chromium-browser',
88 'confdir': 'chromium',
93 'tools/build/linux/sed.sh',
94 'app/resources/manpage.1.in',
97 '<(PRODUCT_DIR)/chrome.1',
100 'tools/build/linux/sed.sh',
101 'app/resources/manpage.1.in',
103 '-e', 's/@@NAME@@/<(name)/',
104 '-e', 's/@@FILENAME@@/<(filename)/',
105 '-e', 's/@@CONFDIR@@/<(confdir)/',
107 'message': 'Generating manpage'
111 ['linux_use_tcmalloc==1', {
113 '<(allocator_target)',
117 ['profiling==0 and linux_disable_pie==0', {
122 ['use_system_xdg_utils==0', {
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',
130 # The wrapper script above may need to generate a .desktop
131 # file, which requires an icon. So, copy one next to the
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']
143 ['toolkit_uses_gtk == 1', {
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
153 }, { # else toolkit_uses_gtk == 1
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
168 'app/chrome_dll_resource.h',
169 'app/chrome_main.cc',
170 'app/chrome_main_delegate.cc',
171 'app/chrome_main_delegate.h',
175 # 'branding' is a variable defined in common.gypi
176 # (e.g. "Chromium", "Chrome")
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',
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',
191 ['mac_breakpad==1', {
193 # A real .dSYM is needed for dump_syms to operate on.
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)',
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',
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': [
227 'postbuild_name': 'Dump Symbols',
229 'dump_product_syms_path':
230 'tools/build/mac/dump_product_syms',
232 'action': ['<(dump_product_syms_path)',
240 'product_name': '<(mac_product_name)',
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)',
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.
261 'mac_bundle_resources': [
262 '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
266 # Generate the InfoPlist.strings file
267 'action_name': 'Generate InfoPlist.strings files',
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',
275 [ 'branding == "Chrome"', {
277 'branding_name': 'google_chrome_strings',
279 }, { # else branding!="Chrome"
281 'branding_name': 'chromium_strings',
288 # TODO: remove this helper when we have loops in GYP
289 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
292 # TODO: remove this helper when we have loops in GYP
293 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
297 '-b', '<(branding_name)',
298 '-v', '<(version_path)',
299 '-g', '<(grit_out_dir)',
300 '-o', '<(output_path)',
304 'message': 'Generating the language InfoPlist.strings files',
305 'process_outputs_as_mac_bundle_resources': 1,
310 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
312 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
313 '<(PRODUCT_DIR)/libplugin_carbon_interpose.dylib',
319 'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
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)',
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
338 'postbuild_name': 'Tweak Info.plist',
339 'action': ['<(tweak_info_plist_path)',
341 '--keystone=<(mac_keystone)',
343 '--pdf=<(internal_pdf)',
344 '--bundle_id=<(mac_bundle_id)'],
347 'postbuild_name': 'Clean up old versions',
349 'tools/build/mac/clean_up_old_versions',
354 # This postbuid step is responsible for creating the following
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.
363 # The EH helper is marked for an executable heap. The NP helper
364 # is marked for no PIE (ASLR).
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',
381 '../build/mac/make_more_helpers.sh',
382 'Versions/<(version_full)',
383 '<(mac_product_name)',
387 # Make sure there isn't any Objective-C in the browser app's
389 'postbuild_name': 'Verify No Objective-C',
391 '../build/mac/verify_no_objc.sh',
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',
411 # CrOS does this in a separate build step.
412 ['OS=="linux" and chromeos==0 and linux_dump_symbols==1', {
414 '../pdf/pdf.gyp:pdf_linux_symbols',
416 }], # OS=="linux" and chromeos==0 and linux_dump_symbols==1
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:flapper_binaries',
427 # Copy CDM files to PRODUCT_DIR if applicable. Let the .gyp
428 # file decide what to do on a per-OS basis; on Mac, internal plugins
429 # go inside the framework, so this dependency is in chrome_dll.gypi.
430 '../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
433 ['OS=="mac" and asan==1', {
435 # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
436 'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
441 ['branding=="Chrome"', {
443 'linux_installer_configs',
448 '../sandbox/sandbox.gyp:sandbox',
451 # For now, do not build nacl_helper when disable_nacl=1
452 # http://code.google.com/p/gyp/issues/detail?id=239
453 ['disable_nacl==0 and coverage==0', {
455 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
465 'chrome_version_resources',
468 '../base/base.gyp:base',
469 '../breakpad/breakpad.gyp:breakpad_handler',
470 '../breakpad/breakpad.gyp:breakpad_sender',
471 '../sandbox/sandbox.gyp:sandbox',
472 'app/policy/cloud_policy_codegen.gyp:policy',
476 'common/crash_keys.cc',
477 'common/crash_keys.h',
478 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
482 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
490 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself.
494 'AdditionalManifestFiles': '$(ProjectDir)\\app\\chrome.exe.manifest',
499 'action_name': 'first_run',
504 '<(PRODUCT_DIR)/First Run',
506 'action': ['cp', '-f', '<@(_inputs)', '<@(_outputs)'],
507 'message': 'Copy first run complete sentinel file',
508 'msvs_cygwin_shell': 1,
513 'app/client_util.cc',
516 ['OS=="win" and component=="shared_library"', {
517 'defines': ['COMPILE_CONTENT_STATICALLY'],
521 '../win8/metro_driver/metro_driver.gyp:*',
522 '../win8/delegate_execute/delegate_execute.gyp:*',
532 'target_name': 'image_pre_reader',
533 'type': 'static_library',
535 'app/image_pre_reader_win.cc',
536 'app/image_pre_reader_win.h',
539 '../base/base.gyp:base',
544 ['disable_nacl!=1 and target_arch=="ia32"', {
547 'target_name': 'chrome_nacl_win64',
548 'type': 'executable',
549 'product_name': 'nacl64',
551 'app/breakpad_win.cc',
552 'app/crash_analysis_win.cc',
553 'app/hard_error_handler_win.cc',
554 'common/crash_keys.cc',
555 'nacl/nacl_exe_win_64.cc',
556 '../content/app/startup_helper_win.cc',
557 '../content/common/sandbox_init_win.cc',
558 '../content/common/sandbox_win.cc',
559 '../content/public/common/content_switches.cc',
560 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/nacl64_exe_version.rc',
563 'app/policy/cloud_policy_codegen.gyp:policy_win64',
564 'chrome_version_resources',
565 'installer_util_nacl_win64',
567 '../breakpad/breakpad.gyp:breakpad_handler_win64',
568 '../breakpad/breakpad.gyp:breakpad_sender_win64',
569 '../base/base.gyp:base_i18n_nacl_win64',
570 '../base/base.gyp:base_nacl_win64',
571 '../base/base.gyp:base_static_win64',
572 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
573 '../chrome/common_constants.gyp:common_constants_win64',
574 '../crypto/crypto.gyp:crypto_nacl_win64',
575 '../ipc/ipc.gyp:ipc_win64',
576 '../sandbox/sandbox.gyp:sandbox_win64',
579 '<@(nacl_win64_defines)',
580 'COMPILE_CONTENT_STATICALLY',
583 '<(SHARED_INTERMEDIATE_DIR)/chrome',
587 'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
588 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
593 'msvs_target_platform': 'x64',
598 }, { # else (disable_nacl==1)
601 'target_name': 'chrome_nacl_win64',