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)' ],
68 # Don't put the 'chrome' target in 'all' on android
69 'suppress_wildcard': 1,
71 ['os_posix == 1 and OS != "mac" and OS != "android"', {
74 'action_name': 'manpage',
76 [ 'branding == "Chrome"', {
78 'name': 'Google Chrome',
79 'filename': 'google-chrome',
80 'confdir': 'google-chrome',
82 }, { # else branding!="Chrome"
85 'filename': 'chromium-browser',
86 'confdir': 'chromium',
91 'tools/build/linux/sed.sh',
92 'app/resources/manpage.1.in',
95 '<(PRODUCT_DIR)/chrome.1',
98 'tools/build/linux/sed.sh',
99 'app/resources/manpage.1.in',
101 '-e', 's/@@NAME@@/<(name)/',
102 '-e', 's/@@FILENAME@@/<(filename)/',
103 '-e', 's/@@CONFDIR@@/<(confdir)/',
105 'message': 'Generating manpage'
109 ['linux_use_tcmalloc==1', {
111 '<(allocator_target)',
115 ['profiling==0 and linux_disable_pie==0', {
120 ['use_system_xdg_utils==0', {
123 'destination': '<(PRODUCT_DIR)',
124 'files': ['tools/build/linux/chrome-wrapper',
125 '../third_party/xdg-utils/scripts/xdg-mime',
126 '../third_party/xdg-utils/scripts/xdg-settings',
128 # The wrapper script above may need to generate a .desktop
129 # file, which requires an icon. So, copy one next to the
132 ['branding=="Chrome"', {
133 'files': ['app/theme/google_chrome/product_logo_48.png']
134 }, { # else: 'branding!="Chrome"
135 'files': ['app/theme/chromium/product_logo_48.png']
141 ['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:gtk',
148 # Needed to use the master_preferences functions
151 }, { # else toolkit_uses_gtk == 1
153 # On Linux, link the dependencies (libraries) that make up actual
154 # Chromium functionality directly into the executable.
155 '<@(chromium_dependencies)',
156 # Needed for chrome_main.cc initialization of libraries.
157 '../build/linux/system.gyp:x11',
158 '../build/linux/system.gyp:pangocairo',
159 '../build/linux/system.gyp:xext',
160 # Needed to use the master_preferences functions
166 'app/chrome_dll_resource.h',
167 'app/chrome_main.cc',
168 'app/chrome_main_delegate.cc',
169 'app/chrome_main_delegate.h',
173 # 'branding' is a variable defined in common.gypi
174 # (e.g. "Chromium", "Chrome")
176 ['branding=="Chrome"', {
177 'mac_bundle_resources': [
178 'app/theme/google_chrome/app.icns',
179 'app/theme/google_chrome/document.icns',
180 'browser/ui/cocoa/applescript/scripting.sdef',
182 }, { # else: 'branding!="Chrome"
183 'mac_bundle_resources': [
184 'app/theme/chromium/app.icns',
185 'app/theme/chromium/document.icns',
186 'browser/ui/cocoa/applescript/scripting.sdef',
189 ['mac_breakpad==1', {
191 # A real .dSYM is needed for dump_syms to operate on.
195 # With mac_real_dsym set, strip_from_xcode won't be used.
196 # Specify CHROMIUM_STRIP_SAVE_FILE directly to Xcode.
197 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
200 '../breakpad/breakpad.gyp:dump_syms',
201 '../breakpad/breakpad.gyp:symupload',
203 # In order to process symbols for the Remoting Host plugin,
204 # that plugin needs to be built beforehand. Since the
205 # "Dump Symbols" step hangs off this target, that plugin also
206 # needs to be added as a dependency.
207 '../remoting/remoting.gyp:remoting_host_plugin',
209 # The "Dump Symbols" post-build step is in a target_conditions
210 # block so that it will follow the "Strip If Needed" step if that
211 # is also being used. There is no standard configuration where
212 # both of these steps occur together, but Mark likes to use this
213 # configuration sometimes when testing Breakpad-enabled builds
214 # without the time overhead of creating real .dSYM files. When
215 # both "Dump Symbols" and "Strip If Needed" are present, "Dump
216 # Symbols" must come second because "Strip If Needed" creates
217 # a fake .dSYM that dump_syms needs to fake dump. Since
218 # "Strip If Needed" is added in a target_conditions block in
219 # common.gypi, "Dump Symbols" needs to be in an (always true)
220 # target_conditions block.
221 'target_conditions': [
225 'postbuild_name': 'Dump Symbols',
227 'dump_product_syms_path':
228 'tools/build/mac/dump_product_syms',
230 'action': ['<(dump_product_syms_path)',
238 'product_name': '<(mac_product_name)',
240 # chrome/app/app-Info.plist has:
241 # CFBundleIdentifier of CHROMIUM_BUNDLE_ID
242 # CFBundleName of CHROMIUM_SHORT_NAME
243 # CFBundleSignature of CHROMIUM_CREATOR
244 # Xcode then replaces these values with the branded values we set
245 # as settings on the target.
246 'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
247 'CHROMIUM_CREATOR': '<(mac_creator)',
248 'CHROMIUM_SHORT_NAME': '<(branding)',
252 'infoplist_strings_tool',
253 'interpose_dependency_shim',
254 'chrome_manifest_bundle',
255 # On Mac, make sure we've built chrome_dll, which contains all of
256 # the library code with Chromium functionality.
259 'mac_bundle_resources': [
260 '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
264 # Generate the InfoPlist.strings file
265 'action_name': 'Generate InfoPlist.strings files',
267 'tool_path': '<(PRODUCT_DIR)/infoplist_strings_tool',
268 # Unique dir to write to so the [lang].lproj/InfoPlist.strings
269 # for the main app and the helper app don't name collide.
270 'output_path': '<(INTERMEDIATE_DIR)/app_infoplist_strings',
273 [ 'branding == "Chrome"', {
275 'branding_name': 'google_chrome_strings',
277 }, { # else branding!="Chrome"
279 'branding_name': 'chromium_strings',
286 # TODO: remove this helper when we have loops in GYP
287 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
290 # TODO: remove this helper when we have loops in GYP
291 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
295 '-b', '<(branding_name)',
296 '-v', '<(version_path)',
297 '-g', '<(grit_out_dir)',
298 '-o', '<(output_path)',
302 'message': 'Generating the language InfoPlist.strings files',
303 'process_outputs_as_mac_bundle_resources': 1,
308 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
310 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
311 '<(PRODUCT_DIR)/libplugin_carbon_interpose.dylib',
317 'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
319 '../build/mac/copy_framework_unversioned.sh',
320 '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Framework.framework',
321 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Versions/<(version_full)',
325 # Modify the Info.plist as needed. The script explains why this
326 # is needed. This is also done in the helper_app and chrome_dll
327 # targets. Use --breakpad=0 to not include any Breakpad
328 # information; that all goes into the framework's Info.plist.
329 # Keystone information is included if Keystone is enabled. The
330 # application reads Keystone keys from this plist and not the
331 # framework's, and the ticket will reference this Info.plist to
332 # determine the tag of the installed product. Use --scm=1 to
333 # include SCM information. The --pdf flag controls whether
334 # to insert PDF as a supported type identifier that can be
336 'postbuild_name': 'Tweak Info.plist',
337 'action': ['<(tweak_info_plist_path)',
339 '--keystone=<(mac_keystone)',
341 '--pdf=<(internal_pdf)',
342 '--bundle_id=<(mac_bundle_id)'],
345 'postbuild_name': 'Clean up old versions',
347 'tools/build/mac/clean_up_old_versions',
352 # This postbuid step is responsible for creating the following
355 # For unofficial Chromium branding, Chromium Helper EH.app and
356 # Chromium Helper NP.app are created from Chromium Helper.app.
357 # For official Google Chrome branding, Google Chrome Helper
358 # EH.app and Google Chrome Helper NP.app are created from
359 # Google Chrome Helper.app.
361 # The EH helper is marked for an executable heap. The NP helper
362 # is marked for no PIE (ASLR).
364 # Normally, applications shipping as part of offical builds with
365 # Google Chrome branding have dsymutil (dwarf-with-dsym,
366 # mac_real_dsym) and dump_syms (mac_breakpad) run on them to
367 # produce a .dSYM bundle and a Breakpad .sym file. This is
368 # unnecessary for the "More Helpers" because they're identical
369 # to the original helper except for the bits in their Mach-O
370 # headers that change to enable or disable special features.
371 # Each .dSYM is identified by UUID stored in a Mach-O file's
372 # LC_UUID load command. Because the "More Helpers" share a UUID
373 # with the original helper, there's no need to run dsymutil
374 # again. All helpers can share the same .dSYM. Special handling
375 # is performed in chrome/tools/build/mac/dump_product_syms to
376 # prepare their Breakpad symbol files.
377 'postbuild_name': 'Make More Helpers',
379 '../build/mac/make_more_helpers.sh',
380 'Versions/<(version_full)',
381 '<(mac_product_name)',
385 # Make sure there isn't any Objective-C in the browser app's
387 'postbuild_name': 'Verify No Objective-C',
389 '../build/mac/verify_no_objc.sh',
396 # 'product_name': 'chromium'
397 # whenever we convert the rest of the infrastructure
398 # (buildbots etc.) to understand the branding gyp define.
399 # NOTE: chrome/app/theme/chromium/BRANDING and
400 # chrome/app/theme/google_chrome/BRANDING have the short name
401 # "chrome" etc.; should we try to extract from there instead?
403 # On Mac, this is done in chrome_dll.gypi.
406 '../pdf/pdf.gyp:pdf',
409 # CrOS does this in a separate build step.
410 ['OS=="linux" and chromeos==0 and linux_dump_symbols==1', {
412 '../pdf/pdf.gyp:pdf_linux_symbols',
414 }], # OS=="linux" and chromeos==0 and linux_dump_symbols==1
419 'chrome_resources.gyp:packed_extra_resources',
420 'chrome_resources.gyp:packed_resources',
421 # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp
422 # file decide what to do on a per-OS basis; on Mac, internal plugins
423 # go inside the framework, so this dependency is in chrome_dll.gypi.
424 '../third_party/adobe/flash/flash_player.gyp:flapper_binaries',
425 # Copy CDM files to PRODUCT_DIR if applicable. Let the .gyp
426 # file decide what to do on a per-OS basis; on Mac, internal plugins
427 # go inside the framework, so this dependency is in chrome_dll.gypi.
428 '../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
431 ['OS=="mac" and asan==1', {
433 # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
434 'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
439 ['branding=="Chrome"', {
441 'linux_installer_configs',
446 '../sandbox/sandbox.gyp:sandbox',
449 # For now, do not build nacl_helper when disable_nacl=1
450 # http://code.google.com/p/gyp/issues/detail?id=239
451 ['disable_nacl==0 and coverage==0', {
453 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
463 'chrome_version_resources',
466 '../base/base.gyp:base',
467 '../breakpad/breakpad.gyp:breakpad_handler',
468 '../breakpad/breakpad.gyp:breakpad_sender',
469 '../sandbox/sandbox.gyp:sandbox',
470 'app/policy/cloud_policy_codegen.gyp:policy',
474 'common/crash_keys.cc',
475 'common/crash_keys.h',
476 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
480 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
488 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself.
492 'AdditionalManifestFiles': '$(ProjectDir)\\app\\chrome.exe.manifest',
497 'action_name': 'first_run',
502 '<(PRODUCT_DIR)/First Run',
504 'action': ['cp', '-f', '<@(_inputs)', '<@(_outputs)'],
505 'message': 'Copy first run complete sentinel file',
506 'msvs_cygwin_shell': 1,
511 'app/client_util.cc',
514 ['OS=="win" and component=="shared_library"', {
515 'defines': ['COMPILE_CONTENT_STATICALLY'],
519 '../win8/metro_driver/metro_driver.gyp:*',
520 '../win8/delegate_execute/delegate_execute.gyp:*',
530 'target_name': 'image_pre_reader',
531 'type': 'static_library',
533 'app/image_pre_reader_win.cc',
534 'app/image_pre_reader_win.h',
537 '../base/base.gyp:base',
542 ['disable_nacl!=1 and target_arch=="ia32"', {
545 'target_name': 'chrome_nacl_win64',
546 'type': 'executable',
547 'product_name': 'nacl64',
549 'app/breakpad_win.cc',
550 'app/hard_error_handler_win.cc',
551 'common/crash_keys.cc',
552 'nacl/nacl_exe_win_64.cc',
553 '../content/app/startup_helper_win.cc',
554 '../content/common/sandbox_init_win.cc',
555 '../content/common/sandbox_win.cc',
556 '../content/public/common/content_switches.cc',
557 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/nacl64_exe_version.rc',
560 'app/policy/cloud_policy_codegen.gyp:policy_win64',
561 'chrome_version_resources',
562 'installer_util_nacl_win64',
564 '../breakpad/breakpad.gyp:breakpad_handler_win64',
565 '../breakpad/breakpad.gyp:breakpad_sender_win64',
566 '../base/base.gyp:base_i18n_nacl_win64',
567 '../base/base.gyp:base_nacl_win64',
568 '../base/base.gyp:base_static_win64',
569 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
570 '../chrome/common_constants.gyp:common_constants_win64',
571 '../crypto/crypto.gyp:crypto_nacl_win64',
572 '../ipc/ipc.gyp:ipc_win64',
573 '../sandbox/sandbox.gyp:sandbox_win64',
576 '<@(nacl_win64_defines)',
577 'COMPILE_CONTENT_STATICALLY',
580 '<(SHARED_INTERMEDIATE_DIR)/chrome',
584 'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
585 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
590 'msvs_target_platform': 'x64',
595 }, { # else (disable_nacl==1)
598 'target_name': 'chrome_nacl_win64',
606 ['test_isolation_mode != "noop"', {
609 'target_name': 'chrome_run',
615 '../build/isolate.gypi',