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"', {
50 'EmbedManifest': 'false',
54 ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
56 '../tools/cygprofile/cygprofile.gyp:cygprofile',
59 ['order_text_section!=""', {
60 'target_conditions' : [
61 ['_toolset=="target"', {
63 '-Wl,-section-ordering-file=<(order_text_section)' ],
67 ['OS == "win" and use_aura==1', {
69 # We still want the _win entry point for sandbox, etc.
70 'app/chrome_exe_main_aura.cc',
74 # Don't put the 'chrome' target in 'all' on android
75 'suppress_wildcard': 1,
77 ['os_posix == 1 and OS != "mac" and OS != "android"', {
80 'action_name': 'manpage',
82 [ 'branding == "Chrome"', {
84 'name': 'Google Chrome',
85 'filename': 'google-chrome',
86 'confdir': 'google-chrome',
88 }, { # else branding!="Chrome"
91 'filename': 'chromium-browser',
92 'confdir': 'chromium',
97 'tools/build/linux/sed.sh',
98 'app/resources/manpage.1.in',
101 '<(PRODUCT_DIR)/chrome.1',
104 'tools/build/linux/sed.sh',
105 'app/resources/manpage.1.in',
107 '-e', 's/@@NAME@@/<(name)/',
108 '-e', 's/@@FILENAME@@/<(filename)/',
109 '-e', 's/@@CONFDIR@@/<(confdir)/',
111 'message': 'Generating manpage'
115 ['linux_use_tcmalloc==1', {
117 '<(allocator_target)',
121 ['profiling==0 and linux_disable_pie==0', {
126 ['use_system_xdg_utils==0', {
129 'destination': '<(PRODUCT_DIR)',
130 'files': ['tools/build/linux/chrome-wrapper',
131 '../third_party/xdg-utils/scripts/xdg-mime',
132 '../third_party/xdg-utils/scripts/xdg-settings',
134 # The wrapper script above may need to generate a .desktop
135 # file, which requires an icon. So, copy one next to the
138 ['branding=="Chrome"', {
139 'files': ['app/theme/google_chrome/product_logo_48.png']
140 }, { # else: 'branding!="Chrome"
141 'files': ['app/theme/chromium/product_logo_48.png']
147 ['toolkit_uses_gtk == 1', {
149 # On Linux, link the dependencies (libraries) that make up actual
150 # Chromium functionality directly into the executable.
151 '<@(chromium_browser_dependencies)',
152 '<@(chromium_child_dependencies)',
153 # Needed for chrome_main.cc initialization of libraries.
154 '../build/linux/system.gyp:gtk',
155 # Needed to use the master_preferences functions
158 }, { # else toolkit_uses_gtk == 1
160 # On Linux, link the dependencies (libraries) that make up actual
161 # Chromium functionality directly into the executable.
162 '<@(chromium_browser_dependencies)',
163 '<@(chromium_child_dependencies)',
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 ['OS=="mac" and asan==1', {
441 # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
442 'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
447 ['branding=="Chrome"', {
449 'linux_installer_configs',
452 # For now, do not build nacl_helper when disable_nacl=1
453 # http://code.google.com/p/gyp/issues/detail?id=239
454 ['disable_nacl==0 and coverage==0', {
456 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
462 '../sandbox/sandbox.gyp:sandbox',
469 'chrome_process_finder',
470 'chrome_version_resources',
473 '../base/base.gyp:base',
474 '../breakpad/breakpad.gyp:breakpad_handler',
475 '../breakpad/breakpad.gyp:breakpad_sender',
476 '../sandbox/sandbox.gyp:sandbox',
477 'app/policy/cloud_policy_codegen.gyp:policy',
481 'common/crash_keys.cc',
482 'common/crash_keys.h',
483 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
487 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
495 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself.
499 'AdditionalManifestFiles': '$(ProjectDir)\\app\\chrome.exe.manifest',
504 'action_name': 'first_run',
509 '<(PRODUCT_DIR)/First Run',
511 'action': ['cp', '-f', '<@(_inputs)', '<@(_outputs)'],
512 'message': 'Copy first run complete sentinel file',
513 'msvs_cygwin_shell': 1,
518 'app/client_util.cc',
521 ['OS=="win" and component=="shared_library"', {
522 'defines': ['COMPILE_CONTENT_STATICALLY'],
526 '../win8/metro_driver/metro_driver.gyp:*',
527 '../win8/delegate_execute/delegate_execute.gyp:*',
537 'target_name': 'image_pre_reader',
538 'type': 'static_library',
540 'app/image_pre_reader_win.cc',
541 'app/image_pre_reader_win.h',
544 '../base/base.gyp:base',
549 ['disable_nacl!=1 and target_arch=="ia32"', {
552 'target_name': 'chrome_nacl_win64',
553 'type': 'executable',
554 'product_name': 'nacl64',
556 'app/breakpad_win.cc',
557 'app/hard_error_handler_win.cc',
558 'common/crash_keys.cc',
559 'nacl/nacl_exe_win_64.cc',
560 '../content/app/startup_helper_win.cc',
561 '../content/common/sandbox_init_win.cc',
562 '../content/common/sandbox_win.cc',
563 '../content/public/common/content_switches.cc',
564 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/nacl64_exe_version.rc',
567 'app/policy/cloud_policy_codegen.gyp:policy_win64',
568 'chrome_version_resources',
569 'installer_util_nacl_win64',
571 '../breakpad/breakpad.gyp:breakpad_handler_win64',
572 '../breakpad/breakpad.gyp:breakpad_sender_win64',
573 '../base/base.gyp:base_i18n_nacl_win64',
574 '../base/base.gyp:base_nacl_win64',
575 '../base/base.gyp:base_static_win64',
576 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
577 '../chrome/common_constants.gyp:common_constants_win64',
578 '../crypto/crypto.gyp:crypto_nacl_win64',
579 '../ipc/ipc.gyp:ipc_win64',
580 '../sandbox/sandbox.gyp:sandbox_win64',
583 '<@(nacl_win64_defines)',
584 'COMPILE_CONTENT_STATICALLY',
587 '<(SHARED_INTERMEDIATE_DIR)/chrome',
591 'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
592 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
597 'msvs_target_platform': 'x64',
602 }, { # else (disable_nacl==1)
605 'target_name': 'chrome_nacl_win64',
613 ['test_isolation_mode != "noop"', {
616 'target_name': 'chrome_run',
622 '../build/isolate.gypi',