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/hard_error_handler_win.cc',
28 'app/hard_error_handler_win.h',
29 'app/metro_driver_win.cc',
30 'app/metro_driver_win.h',
31 '../content/app/startup_helper_win.cc',
33 'mac_bundle_resources': [
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
39 'mac_bundle_resources!': [
43 'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves',
44 'INFOPLIST_FILE': 'app/app-Info.plist',
47 ['component == "shared_library"', {
49 'win_use_external_manifest': 1,
52 ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
54 '../tools/cygprofile/cygprofile.gyp:cygprofile',
57 ['order_text_section!=""', {
58 'target_conditions' : [
59 ['_toolset=="target"', {
61 '-Wl,-section-ordering-file=<(order_text_section)' ],
65 ['OS == "win" and use_aura==1', {
67 # We still want the _win entry point for sandbox, etc.
68 'app/chrome_exe_main_aura.cc',
72 # Don't put the 'chrome' target in 'all' on android
73 'suppress_wildcard': 1,
75 ['os_posix == 1 and OS != "mac" and OS != "android"', {
78 'action_name': 'manpage',
80 [ 'branding == "Chrome"', {
82 'name': 'Google Chrome',
83 'filename': 'google-chrome',
84 'confdir': 'google-chrome',
86 }, { # else branding!="Chrome"
89 'filename': 'chromium-browser',
90 'confdir': 'chromium',
95 'tools/build/linux/sed.sh',
96 'app/resources/manpage.1.in',
99 '<(PRODUCT_DIR)/chrome.1',
102 'tools/build/linux/sed.sh',
103 'app/resources/manpage.1.in',
105 '-e', 's/@@NAME@@/<(name)/',
106 '-e', 's/@@FILENAME@@/<(filename)/',
107 '-e', 's/@@CONFDIR@@/<(confdir)/',
109 'message': 'Generating manpage'
113 ['linux_use_tcmalloc==1', {
115 '<(allocator_target)',
119 ['profiling==0 and linux_disable_pie==0', {
124 ['use_system_xdg_utils==0', {
127 'destination': '<(PRODUCT_DIR)',
128 'files': ['tools/build/linux/chrome-wrapper',
129 '../third_party/xdg-utils/scripts/xdg-mime',
130 '../third_party/xdg-utils/scripts/xdg-settings',
132 # The wrapper script above may need to generate a .desktop
133 # file, which requires an icon. So, copy one next to the
136 ['branding=="Chrome"', {
137 'files': ['app/theme/google_chrome/product_logo_48.png']
138 }, { # else: 'branding!="Chrome"
139 'files': ['app/theme/chromium/product_logo_48.png']
145 ['toolkit_uses_gtk == 1', {
147 # On Linux, link the dependencies (libraries) that make up actual
148 # Chromium functionality directly into the executable.
149 '<@(chromium_browser_dependencies)',
150 '<@(chromium_child_dependencies)',
151 '../content/content.gyp:content_app_both',
152 # Needed for chrome_main.cc initialization of libraries.
153 '../build/linux/system.gyp:gtk',
154 # Needed to use the master_preferences functions
157 }, { # else toolkit_uses_gtk == 1
159 # On Linux, link the dependencies (libraries) that make up actual
160 # Chromium functionality directly into the executable.
161 '<@(chromium_browser_dependencies)',
162 '<@(chromium_child_dependencies)',
163 '../content/content.gyp:content_app_both',
164 # Needed for chrome_main.cc initialization of libraries.
165 '../build/linux/system.gyp:x11',
166 '../build/linux/system.gyp:pangocairo',
167 '../build/linux/system.gyp:xext',
168 # Needed to use the master_preferences functions
174 'app/chrome_dll_resource.h',
175 'app/chrome_main.cc',
176 'app/chrome_main_delegate.cc',
177 'app/chrome_main_delegate.h',
181 # 'branding' is a variable defined in common.gypi
182 # (e.g. "Chromium", "Chrome")
184 ['branding=="Chrome"', {
185 'mac_bundle_resources': [
186 'app/theme/google_chrome/app.icns',
187 'app/theme/google_chrome/document.icns',
188 'browser/ui/cocoa/applescript/scripting.sdef',
190 }, { # else: 'branding!="Chrome"
191 'mac_bundle_resources': [
192 'app/theme/chromium/app.icns',
193 'app/theme/chromium/document.icns',
194 'browser/ui/cocoa/applescript/scripting.sdef',
197 ['mac_breakpad==1', {
199 # A real .dSYM is needed for dump_syms to operate on.
203 # With mac_real_dsym set, strip_from_xcode won't be used.
204 # Specify CHROMIUM_STRIP_SAVE_FILE directly to Xcode.
205 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
208 '../breakpad/breakpad.gyp:dump_syms',
209 '../breakpad/breakpad.gyp:symupload',
211 # In order to process symbols for the Remoting Host plugin,
212 # that plugin needs to be built beforehand. Since the
213 # "Dump Symbols" step hangs off this target, that plugin also
214 # needs to be added as a dependency.
215 '../remoting/remoting.gyp:remoting_host_plugin',
217 # The "Dump Symbols" post-build step is in a target_conditions
218 # block so that it will follow the "Strip If Needed" step if that
219 # is also being used. There is no standard configuration where
220 # both of these steps occur together, but Mark likes to use this
221 # configuration sometimes when testing Breakpad-enabled builds
222 # without the time overhead of creating real .dSYM files. When
223 # both "Dump Symbols" and "Strip If Needed" are present, "Dump
224 # Symbols" must come second because "Strip If Needed" creates
225 # a fake .dSYM that dump_syms needs to fake dump. Since
226 # "Strip If Needed" is added in a target_conditions block in
227 # common.gypi, "Dump Symbols" needs to be in an (always true)
228 # target_conditions block.
229 'target_conditions': [
233 'postbuild_name': 'Dump Symbols',
235 'dump_product_syms_path':
236 'tools/build/mac/dump_product_syms',
238 'action': ['<(dump_product_syms_path)',
246 'product_name': '<(mac_product_name)',
248 # chrome/app/app-Info.plist has:
249 # CFBundleIdentifier of CHROMIUM_BUNDLE_ID
250 # CFBundleName of CHROMIUM_SHORT_NAME
251 # CFBundleSignature of CHROMIUM_CREATOR
252 # Xcode then replaces these values with the branded values we set
253 # as settings on the target.
254 'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
255 'CHROMIUM_CREATOR': '<(mac_creator)',
256 'CHROMIUM_SHORT_NAME': '<(branding)',
260 'infoplist_strings_tool',
261 'interpose_dependency_shim',
262 'chrome_manifest_bundle',
263 # On Mac, make sure we've built chrome_dll, which contains all of
264 # the library code with Chromium functionality.
267 'mac_bundle_resources': [
268 '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
272 # Generate the InfoPlist.strings file
273 'action_name': 'Generate InfoPlist.strings files',
275 'tool_path': '<(PRODUCT_DIR)/infoplist_strings_tool',
276 # Unique dir to write to so the [lang].lproj/InfoPlist.strings
277 # for the main app and the helper app don't name collide.
278 'output_path': '<(INTERMEDIATE_DIR)/app_infoplist_strings',
281 [ 'branding == "Chrome"', {
283 'branding_name': 'google_chrome_strings',
285 }, { # else branding!="Chrome"
287 'branding_name': 'chromium_strings',
294 # TODO: remove this helper when we have loops in GYP
295 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
298 # TODO: remove this helper when we have loops in GYP
299 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
303 '-b', '<(branding_name)',
304 '-v', '<(version_path)',
305 '-g', '<(grit_out_dir)',
306 '-o', '<(output_path)',
310 'message': 'Generating the language InfoPlist.strings files',
311 'process_outputs_as_mac_bundle_resources': 1,
316 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
318 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
319 '<(PRODUCT_DIR)/libplugin_carbon_interpose.dylib',
325 'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
327 '../build/mac/copy_framework_unversioned.sh',
328 '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Framework.framework',
329 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Versions/<(version_full)',
333 # Modify the Info.plist as needed. The script explains why this
334 # is needed. This is also done in the helper_app and chrome_dll
335 # targets. Use --breakpad=0 to not include any Breakpad
336 # information; that all goes into the framework's Info.plist.
337 # Keystone information is included if Keystone is enabled. The
338 # application reads Keystone keys from this plist and not the
339 # framework's, and the ticket will reference this Info.plist to
340 # determine the tag of the installed product. Use --scm=1 to
341 # include SCM information. The --pdf flag controls whether
342 # to insert PDF as a supported type identifier that can be
344 'postbuild_name': 'Tweak Info.plist',
345 'action': ['<(tweak_info_plist_path)',
347 '--keystone=<(mac_keystone)',
349 '--pdf=<(internal_pdf)',
350 '--bundle_id=<(mac_bundle_id)'],
353 'postbuild_name': 'Clean up old versions',
355 'tools/build/mac/clean_up_old_versions',
360 # This postbuid step is responsible for creating the following
363 # For unofficial Chromium branding, Chromium Helper EH.app and
364 # Chromium Helper NP.app are created from Chromium Helper.app.
365 # For official Google Chrome branding, Google Chrome Helper
366 # EH.app and Google Chrome Helper NP.app are created from
367 # Google Chrome Helper.app.
369 # The EH helper is marked for an executable heap. The NP helper
370 # is marked for no PIE (ASLR).
372 # Normally, applications shipping as part of offical builds with
373 # Google Chrome branding have dsymutil (dwarf-with-dsym,
374 # mac_real_dsym) and dump_syms (mac_breakpad) run on them to
375 # produce a .dSYM bundle and a Breakpad .sym file. This is
376 # unnecessary for the "More Helpers" because they're identical
377 # to the original helper except for the bits in their Mach-O
378 # headers that change to enable or disable special features.
379 # Each .dSYM is identified by UUID stored in a Mach-O file's
380 # LC_UUID load command. Because the "More Helpers" share a UUID
381 # with the original helper, there's no need to run dsymutil
382 # again. All helpers can share the same .dSYM. Special handling
383 # is performed in chrome/tools/build/mac/dump_product_syms to
384 # prepare their Breakpad symbol files.
385 'postbuild_name': 'Make More Helpers',
387 '../build/mac/make_more_helpers.sh',
388 'Versions/<(version_full)',
389 '<(mac_product_name)',
393 # Make sure there isn't any Objective-C in the browser app's
395 'postbuild_name': 'Verify No Objective-C',
397 '../build/mac/verify_no_objc.sh',
404 # 'product_name': 'chromium'
405 # whenever we convert the rest of the infrastructure
406 # (buildbots etc.) to understand the branding gyp define.
407 # NOTE: chrome/app/theme/chromium/BRANDING and
408 # chrome/app/theme/google_chrome/BRANDING have the short name
409 # "chrome" etc.; should we try to extract from there instead?
411 # On Mac, this is done in chrome_dll.gypi.
414 '../pdf/pdf.gyp:pdf',
417 # CrOS does this in a separate build step.
418 ['OS=="linux" and chromeos==0 and linux_dump_symbols==1', {
420 '../pdf/pdf.gyp:pdf_linux_symbols',
422 }], # OS=="linux" and chromeos==0 and linux_dump_symbols==1
427 'chrome_resources.gyp:packed_extra_resources',
428 'chrome_resources.gyp:packed_resources',
429 # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp
430 # file decide what to do on a per-OS basis; on Mac, internal plugins
431 # go inside the framework, so this dependency is in chrome_dll.gypi.
432 '../third_party/adobe/flash/flash_player.gyp:flapper_binaries',
433 # Copy CDM files to PRODUCT_DIR if applicable. Let the .gyp
434 # file decide what to do on a per-OS basis; on Mac, internal plugins
435 # go inside the framework, so this dependency is in chrome_dll.gypi.
436 '../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
439 ['chrome_multiple_dll', {
440 'defines': ['CHROME_MULTIPLE_DLL'],
442 ['OS=="mac" and asan==1', {
444 # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
445 'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
450 ['branding=="Chrome"', {
452 'linux_installer_configs',
455 # For now, do not build nacl_helper when disable_nacl=1
456 # http://code.google.com/p/gyp/issues/detail?id=239
457 ['disable_nacl==0 and coverage==0', {
459 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
465 '../sandbox/sandbox.gyp:sandbox',
472 'chrome_process_finder',
473 'chrome_version_resources',
476 '../base/base.gyp:base',
477 '../breakpad/breakpad.gyp:breakpad_handler',
478 '../breakpad/breakpad.gyp:breakpad_sender',
479 '../components/components.gyp:breakpad_component',
480 '../sandbox/sandbox.gyp:sandbox',
481 'app/policy/cloud_policy_codegen.gyp:policy',
484 'app/chrome_breakpad_client.cc',
485 'app/chrome_breakpad_client.h',
487 'common/crash_keys.cc',
488 'common/crash_keys.h',
489 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
493 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
501 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself.
505 'AdditionalManifestFiles': [
506 '$(ProjectDir)\\app\\chrome.exe.manifest',
512 'action_name': 'first_run',
517 '<(PRODUCT_DIR)/First Run',
519 'action': ['cp', '-f', '<@(_inputs)', '<@(_outputs)'],
520 'message': 'Copy first run complete sentinel file',
521 'msvs_cygwin_shell': 1,
526 'app/client_util.cc',
529 ['OS=="win" and component=="shared_library"', {
530 'defines': ['COMPILE_CONTENT_STATICALLY'],
534 '../win8/metro_driver/metro_driver.gyp:*',
535 '../win8/delegate_execute/delegate_execute.gyp:*',
545 'target_name': 'image_pre_reader',
546 'type': 'static_library',
548 'app/image_pre_reader_win.cc',
549 'app/image_pre_reader_win.h',
552 '../base/base.gyp:base',
557 ['disable_nacl!=1 and target_arch=="ia32"', {
560 'target_name': 'chrome_nacl_win64',
561 'type': 'executable',
562 'product_name': 'nacl64',
564 'app/breakpad_win.cc',
565 'app/chrome_breakpad_client.cc',
566 'app/hard_error_handler_win.cc',
567 'common/crash_keys.cc',
568 'nacl/nacl_exe_win_64.cc',
569 '../content/app/startup_helper_win.cc',
570 '../content/common/sandbox_init_win.cc',
571 '../content/common/sandbox_win.cc',
572 '../content/public/common/content_switches.cc',
573 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/nacl64_exe_version.rc',
576 'app/policy/cloud_policy_codegen.gyp:policy_win64',
577 'chrome_version_resources',
578 'installer_util_nacl_win64',
579 '../breakpad/breakpad.gyp:breakpad_handler_win64',
580 '../breakpad/breakpad.gyp:breakpad_sender_win64',
581 '../base/base.gyp:base_i18n_nacl_win64',
582 '../base/base.gyp:base_nacl_win64',
583 '../base/base.gyp:base_static_win64',
584 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
585 '../components/components.gyp:breakpad_win64',
586 '../chrome/common_constants.gyp:common_constants_win64',
587 '../components/nacl.gyp:nacl_win64',
588 '../crypto/crypto.gyp:crypto_nacl_win64',
589 '../ipc/ipc.gyp:ipc_win64',
590 '../sandbox/sandbox.gyp:sandbox_win64',
593 '<@(nacl_win64_defines)',
594 'COMPILE_CONTENT_STATICALLY',
597 '<(SHARED_INTERMEDIATE_DIR)/chrome',
601 'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
602 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
607 'msvs_target_platform': 'x64',
612 }, { # else (disable_nacl==1)
615 'target_name': 'chrome_nacl_win64',
623 ['test_isolation_mode != "noop"', {
626 'target_name': 'chrome_run',
632 '../build/isolate.gypi',