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',
10 'dependencies': [ 'chrome_initial', ],
12 ['OS=="linux" and clang_type_profiler==1', {
14 '<(DEPTH)/base/allocator/allocator.gyp:type_profiler',
21 'reorder_py_path': '<(DEPTH)/build/win/reorder-imports.py',
22 # See comment in chrome_dll.gypi in the hardlink_to_output
23 # target for why this cannot be 'initial' like the DLL.
24 'exe_input_path':'$(OutDir)\\initialexe',
25 'exe_output_path':'<(PRODUCT_DIR)',
27 'action_name': 'reorder_imports',
30 '$(OutDir)\\initialexe\\chrome.exe',
33 '<(PRODUCT_DIR)\\chrome.exe',
34 '<(PRODUCT_DIR)\\chrome.exe.pdb',
39 '-i', '<(exe_input_path)',
40 '-o', '<(exe_output_path)',
41 '-a', '<(target_arch)',
43 'message': 'Reordering Imports',
50 # GN version: //chrome
51 'target_name': 'chrome_initial',
53 # Name the exe chrome.exe, not chrome_initial.exe.
54 'product_name': 'chrome',
57 'use_system_xdg_utils%': 0,
58 'enable_wexit_time_destructors': 1,
61 'app/chrome_exe_main_aura.cc',
62 'app/chrome_exe_main_mac.cc',
63 'app/chrome_exe_main_win.cc',
64 'app/chrome_exe_resource.h',
67 'app/signature_validator_win.cc',
68 'app/signature_validator_win.h',
69 # Note that due to InitializeSandboxInfo, this must be directly linked
70 # into chrome.exe, not into a dependent.
71 '<(DEPTH)/content/app/startup_helper_win.cc',
72 '<(DEPTH)/content/public/common/content_switches.cc',
74 'mac_bundle_resources': [
77 # TODO(mark): Come up with a fancier way to do this. It should only
78 # be necessary to list app-Info.plist once, not the three times it is
80 'mac_bundle_resources!': [
84 'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves',
85 'INFOPLIST_FILE': 'app/app-Info.plist',
88 ['order_profiling!=0 and (chromeos==1 or OS=="linux")', {
90 '../tools/cygprofile/cygprofile.gyp:cygprofile',
93 ['order_text_section!=""', {
94 'target_conditions' : [
95 ['_toolset=="target"', {
97 '-Wl,-section-ordering-file=<(order_text_section)' ],
101 ['OS == "android"', {
102 # Don't put the 'chrome' target in 'all' on android
103 'suppress_wildcard': 1,
105 ['os_posix == 1 and OS != "mac" and OS != "android"', {
108 'action_name': 'manpage',
110 [ 'branding == "Chrome"', {
112 'name': 'Google Chrome',
113 'filename': 'google-chrome',
114 'confdir': 'google-chrome',
116 }, { # else branding!="Chrome"
119 'filename': 'chromium-browser',
120 'confdir': 'chromium',
125 'tools/build/linux/sed.sh',
126 'app/resources/manpage.1.in',
129 '<(PRODUCT_DIR)/chrome.1',
132 'tools/build/linux/sed.sh',
133 'app/resources/manpage.1.in',
135 '-e', 's/@@NAME@@/<(name)/',
136 '-e', 's/@@FILENAME@@/<(filename)/',
137 '-e', 's/@@CONFDIR@@/<(confdir)/',
139 'message': 'Generating manpage'
143 ['use_allocator!="none"', {
145 '<(allocator_target)',
149 ['profiling==0 and linux_disable_pie==0', {
154 ['use_system_xdg_utils==0', {
157 'destination': '<(PRODUCT_DIR)',
158 'files': ['tools/build/linux/chrome-wrapper',
159 '../third_party/xdg-utils/scripts/xdg-mime',
160 '../third_party/xdg-utils/scripts/xdg-settings',
162 # The wrapper script above may need to generate a .desktop
163 # file, which requires an icon. So, copy one next to the
166 ['branding=="Chrome"', {
167 'files': ['app/theme/google_chrome/product_logo_48.png']
168 }, { # else: 'branding!="Chrome"
169 'files': ['app/theme/chromium/product_logo_48.png']
175 # x11 build. Needed for chrome_main.cc initialization of libraries.
178 '../build/linux/system.gyp:x11',
179 '../build/linux/system.gyp:xext',
184 'app/chrome_dll_resource.h',
185 'app/chrome_main.cc',
186 'app/chrome_main_delegate.cc',
187 'app/chrome_main_delegate.h',
190 # On Linux, link the dependencies (libraries) that make up actual
191 # Chromium functionality directly into the executable.
192 '<@(chromium_browser_dependencies)',
193 '<@(chromium_child_dependencies)',
194 '../content/content.gyp:content_app_both',
195 # Needed for chrome_main.cc initialization of libraries.
196 '../build/linux/system.gyp:pangocairo',
197 # Needed to use the master_preferences functions
202 # 'branding' is a variable defined in common.gypi
203 # (e.g. "Chromium", "Chrome")
205 ['branding=="Chrome"', {
206 'mac_bundle_resources': [
207 'app/theme/google_chrome/mac/app.icns',
208 'app/theme/google_chrome/mac/document.icns',
209 'browser/ui/cocoa/applescript/scripting.sdef',
211 }, { # else: 'branding!="Chrome"
212 'mac_bundle_resources': [
213 'app/theme/chromium/mac/app.icns',
214 'app/theme/chromium/mac/document.icns',
215 'browser/ui/cocoa/applescript/scripting.sdef',
218 ['mac_breakpad==1', {
220 # A real .dSYM is needed for dump_syms to operate on.
224 # With mac_real_dsym set, strip_from_xcode won't be used.
225 # Specify CHROMIUM_STRIP_SAVE_FILE directly to Xcode.
226 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
229 '../breakpad/breakpad.gyp:dump_syms',
230 '../breakpad/breakpad.gyp:symupload',
232 # The "Dump Symbols" post-build step is in a target_conditions
233 # block so that it will follow the "Strip If Needed" step if that
234 # is also being used. There is no standard configuration where
235 # both of these steps occur together, but Mark likes to use this
236 # configuration sometimes when testing Breakpad-enabled builds
237 # without the time overhead of creating real .dSYM files. When
238 # both "Dump Symbols" and "Strip If Needed" are present, "Dump
239 # Symbols" must come second because "Strip If Needed" creates
240 # a fake .dSYM that dump_syms needs to fake dump. Since
241 # "Strip If Needed" is added in a target_conditions block in
242 # common.gypi, "Dump Symbols" needs to be in an (always true)
243 # target_conditions block.
244 'target_conditions': [
248 'postbuild_name': 'Dump Symbols',
250 'dump_product_syms_path':
251 'tools/build/mac/dump_product_syms',
253 'action': ['<(dump_product_syms_path)',
261 'product_name': '<(mac_product_name)',
263 # chrome/app/app-Info.plist has:
264 # CFBundleIdentifier of CHROMIUM_BUNDLE_ID
265 # CFBundleName of CHROMIUM_SHORT_NAME
266 # CFBundleSignature of CHROMIUM_CREATOR
267 # Xcode then replaces these values with the branded values we set
268 # as settings on the target.
269 'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
270 'CHROMIUM_CREATOR': '<(mac_creator)',
271 'CHROMIUM_SHORT_NAME': '<(branding)',
274 '../components/components.gyp:chrome_manifest_bundle',
276 'infoplist_strings_tool',
277 # On Mac, make sure we've built chrome_dll, which contains all of
278 # the library code with Chromium functionality.
281 'mac_bundle_resources': [
282 '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
286 # Generate the InfoPlist.strings file
287 'action_name': 'Generate InfoPlist.strings files',
289 'tool_path': '<(PRODUCT_DIR)/infoplist_strings_tool',
290 # Unique dir to write to so the [lang].lproj/InfoPlist.strings
291 # for the main app and the helper app don't name collide.
292 'output_path': '<(INTERMEDIATE_DIR)/app_infoplist_strings',
295 [ 'branding == "Chrome"', {
297 'branding_name': 'google_chrome_strings',
299 }, { # else branding!="Chrome"
301 'branding_name': 'chromium_strings',
308 # TODO: remove this helper when we have loops in GYP
309 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
312 # TODO: remove this helper when we have loops in GYP
313 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
317 '-b', '<(branding_name)',
318 '-v', '<(version_path)',
319 '-g', '<(grit_out_dir)',
320 '-o', '<(output_path)',
324 'message': 'Generating the language InfoPlist.strings files',
325 'process_outputs_as_mac_bundle_resources': 1,
330 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
332 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
338 'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
340 '../build/mac/copy_framework_unversioned.sh',
341 '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Framework.framework',
342 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Versions/<(version_full)',
346 # Modify the Info.plist as needed. The script explains why this
347 # is needed. This is also done in the helper_app and chrome_dll
348 # targets. Use --breakpad=0 to not include any Breakpad
349 # information; that all goes into the framework's Info.plist.
350 # Keystone information is included if Keystone is enabled. The
351 # application reads Keystone keys from this plist and not the
352 # framework's, and the ticket will reference this Info.plist to
353 # determine the tag of the installed product. Use --scm=1 to
354 # include SCM information.
355 'postbuild_name': 'Tweak Info.plist',
356 'action': ['<(tweak_info_plist_path)',
358 '--keystone=<(mac_keystone)',
360 '--bundle_id=<(mac_bundle_id)'],
363 'postbuild_name': 'Clean up old versions',
365 'tools/build/mac/clean_up_old_versions',
370 # This postbuid step is responsible for creating the following
373 # For unofficial Chromium branding, Chromium Helper EH.app and
374 # Chromium Helper NP.app are created from Chromium Helper.app.
375 # For official Google Chrome branding, Google Chrome Helper
376 # EH.app and Google Chrome Helper NP.app are created from
377 # Google Chrome Helper.app.
379 # The EH helper is marked for an executable heap. The NP helper
380 # is marked for no PIE (ASLR).
382 # Normally, applications shipping as part of offical builds with
383 # Google Chrome branding have dsymutil (dwarf-with-dsym,
384 # mac_real_dsym) and dump_syms (mac_breakpad) run on them to
385 # produce a .dSYM bundle and a Breakpad .sym file. This is
386 # unnecessary for the "More Helpers" because they're identical
387 # to the original helper except for the bits in their Mach-O
388 # headers that change to enable or disable special features.
389 # Each .dSYM is identified by UUID stored in a Mach-O file's
390 # LC_UUID load command. Because the "More Helpers" share a UUID
391 # with the original helper, there's no need to run dsymutil
392 # again. All helpers can share the same .dSYM. Special handling
393 # is performed in chrome/tools/build/mac/dump_product_syms to
394 # prepare their Breakpad symbol files.
395 'postbuild_name': 'Make More Helpers',
397 '../build/mac/make_more_helpers.sh',
398 'Versions/<(version_full)',
399 '<(mac_product_name)',
403 # Make sure there isn't any Objective-C in the browser app's
405 'postbuild_name': 'Verify No Objective-C',
407 '../build/mac/verify_no_objc.sh',
414 # 'product_name': 'chromium'
415 # whenever we convert the rest of the infrastructure
416 # (buildbots etc.) to understand the branding gyp define.
417 # NOTE: chrome/app/theme/chromium/BRANDING and
418 # chrome/app/theme/google_chrome/BRANDING have the short name
419 # "chrome" etc.; should we try to extract from there instead?
421 # CrOS does this in a separate build step.
422 ['OS=="linux" and chromeos==0 and linux_dump_symbols==1', {
424 '../pdf/pdf.gyp:pdf_linux_symbols',
426 }], # OS=="linux" and chromeos==0 and linux_dump_symbols==1
427 # Android doesn't use pdfium.
430 # On Mac, this is done in chrome_dll.gypi.
431 '../pdf/pdf.gyp:pdf',
436 '../components/components.gyp:startup_metric_utils',
437 'chrome_resources.gyp:packed_extra_resources',
438 'chrome_resources.gyp:packed_resources',
439 # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp
440 # file decide what to do on a per-OS basis; on Mac, internal plugins
441 # go inside the framework, so this dependency is in chrome_dll.gypi.
442 '../third_party/adobe/flash/flash_player.gyp:flapper_binaries',
443 # Copy CDM files to PRODUCT_DIR if applicable. Let the .gyp
444 # file decide what to do on a per-OS basis; on Mac, internal plugins
445 # go inside the framework, so this dependency is in chrome_dll.gypi.
446 '../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
449 ['chrome_multiple_dll', {
450 'defines': ['CHROME_MULTIPLE_DLL'],
452 ['OS=="mac" and asan==1', {
454 # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
455 'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
460 ['branding=="Chrome"', {
462 'linux_installer_configs',
465 # For now, do not build nacl_helper when disable_nacl=1
466 # http://code.google.com/p/gyp/issues/detail?id=239
467 ['disable_nacl==0', {
469 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
470 '../components/nacl.gyp:nacl_helper',
471 '../components/nacl_nonsfi.gyp:nacl_helper_nonsfi',
476 '../sandbox/sandbox.gyp:sandbox',
483 'chrome_process_finder',
484 'chrome_version_resources',
487 '../base/base.gyp:base',
488 '../crypto/crypto.gyp:crypto',
489 '../breakpad/breakpad.gyp:breakpad_handler',
490 '../breakpad/breakpad.gyp:breakpad_sender',
491 '../chrome_elf/chrome_elf.gyp:chrome_elf',
492 '../components/components.gyp:crash_component',
493 '../sandbox/sandbox.gyp:sandbox',
494 '../ui/gfx/gfx.gyp:gfx',
495 '../win8/metro_driver/metro_driver.gyp:metro_driver',
496 '../win8/delegate_execute/delegate_execute.gyp:*',
499 'app/chrome_crash_reporter_client.cc',
500 'app/chrome_crash_reporter_client.h',
502 'common/crash_keys.cc',
503 'common/crash_keys.h',
504 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
507 # We still want the _win entry point for sandbox, etc.
508 'app/chrome_exe_main_aura.cc',
512 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
513 'OutputFile': '$(OutDir)\\initialexe\\chrome.exe',
521 'AdditionalDependencies': [
527 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself, except for the
528 # AddressSanitizer build where console output is important.
534 'AdditionalManifestFiles': [
535 '$(ProjectDir)\\app\\chrome.exe.manifest',
536 '<(SHARED_INTERMEDIATE_DIR)/chrome/app/version_assembly/version_assembly.manifest',
541 ['configuration_policy==1', {
543 '<(DEPTH)/components/components.gyp:policy',
549 'action_name': 'first_run',
554 '<(PRODUCT_DIR)/First Run',
556 'action': ['python', '../build/cp.py', '<@(_inputs)', '<@(_outputs)'],
557 'message': 'Copy first run complete sentinel file',
560 'action_name': 'chrome_exe_manifest',
562 'app/version_assembly/chrome_exe_manifest_action.gypi',
566 'action_name': 'version_assembly_manifest',
568 'app/version_assembly/version_assembly_manifest_action.gypi',
574 'app/client_util.cc',
577 ['OS=="win" and component=="shared_library"', {
578 'defines': ['COMPILE_CONTENT_STATICALLY'],
587 'target_name': 'image_pre_reader',
588 'type': 'static_library',
590 'app/image_pre_reader_win.cc',
591 'app/image_pre_reader_win.h',
594 '../base/base.gyp:base',
599 ['disable_nacl!=1 and target_arch=="ia32"', {
602 'target_name': 'chrome_nacl_win64',
603 'type': 'executable',
604 'product_name': 'nacl64',
606 'app/chrome_crash_reporter_client.cc',
607 'common/crash_keys.cc',
608 'nacl/nacl_exe_win_64.cc',
609 '../content/app/startup_helper_win.cc',
610 '../content/common/sandbox_init_win.cc',
611 '../content/common/sandbox_win.cc',
612 '../content/public/common/content_switches.cc',
613 '../content/public/common/sandboxed_process_launcher_delegate.cc',
614 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/nacl64_exe_version.rc',
617 'chrome_version_resources',
618 'installer_util_nacl_win64',
619 '../base/base.gyp:base_i18n_nacl_win64',
620 '../base/base.gyp:base_win64',
621 '../base/base.gyp:base_static_win64',
622 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
623 '../breakpad/breakpad.gyp:breakpad_handler_win64',
624 '../breakpad/breakpad.gyp:breakpad_sender_win64',
625 '../components/components.gyp:breakpad_win64',
626 '../chrome/common_constants.gyp:common_constants_win64',
627 '../components/nacl.gyp:nacl_win64',
628 '../crypto/crypto.gyp:crypto_nacl_win64',
629 '../ipc/ipc.gyp:ipc_win64',
630 '../sandbox/sandbox.gyp:sandbox_win64',
633 '<@(nacl_win64_defines)',
634 'COMPILE_CONTENT_STATICALLY',
637 '<(SHARED_INTERMEDIATE_DIR)/chrome',
641 'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
642 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
647 'msvs_target_platform': 'x64',
651 ['configuration_policy==1', {
653 '<(DEPTH)/components/components.gyp:policy_win64',
659 }, { # else (disable_nacl==1)
662 'target_name': 'chrome_nacl_win64',
670 ['test_isolation_mode != "noop"', {
673 'target_name': 'chrome_run',
677 # Runtime dependencies
678 '../third_party/mesa/mesa.gyp:osmesa',
681 '../build/isolate.gypi',