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)' ],
103 # We still want the _win entry point for sandbox, etc.
104 'app/chrome_exe_main_aura.cc',
107 '../ui/gfx/gfx.gyp:gfx',
110 ['OS == "android"', {
111 # Don't put the 'chrome' target in 'all' on android
112 'suppress_wildcard': 1,
114 ['os_posix == 1 and OS != "mac" and OS != "android"', {
117 'action_name': 'manpage',
119 [ 'branding == "Chrome"', {
121 'name': 'Google Chrome',
122 'filename': 'google-chrome',
123 'confdir': 'google-chrome',
125 }, { # else branding!="Chrome"
128 'filename': 'chromium-browser',
129 'confdir': 'chromium',
134 'tools/build/linux/sed.sh',
135 'app/resources/manpage.1.in',
138 '<(PRODUCT_DIR)/chrome.1',
141 'tools/build/linux/sed.sh',
142 'app/resources/manpage.1.in',
144 '-e', 's/@@NAME@@/<(name)/',
145 '-e', 's/@@FILENAME@@/<(filename)/',
146 '-e', 's/@@CONFDIR@@/<(confdir)/',
148 'message': 'Generating manpage'
152 ['use_allocator!="none"', {
154 '<(allocator_target)',
158 ['profiling==0 and linux_disable_pie==0', {
163 ['use_system_xdg_utils==0', {
166 'destination': '<(PRODUCT_DIR)',
167 'files': ['tools/build/linux/chrome-wrapper',
168 '../third_party/xdg-utils/scripts/xdg-mime',
169 '../third_party/xdg-utils/scripts/xdg-settings',
171 # The wrapper script above may need to generate a .desktop
172 # file, which requires an icon. So, copy one next to the
175 ['branding=="Chrome"', {
176 'files': ['app/theme/google_chrome/product_logo_48.png']
177 }, { # else: 'branding!="Chrome"
178 'files': ['app/theme/chromium/product_logo_48.png']
184 # x11 build. Needed for chrome_main.cc initialization of libraries.
187 '../build/linux/system.gyp:x11',
188 '../build/linux/system.gyp:xext',
193 'app/chrome_dll_resource.h',
194 'app/chrome_main.cc',
195 'app/chrome_main_delegate.cc',
196 'app/chrome_main_delegate.h',
199 # On Linux, link the dependencies (libraries) that make up actual
200 # Chromium functionality directly into the executable.
201 '<@(chromium_browser_dependencies)',
202 '<@(chromium_child_dependencies)',
203 '../content/content.gyp:content_app_both',
204 # Needed for chrome_main.cc initialization of libraries.
205 '../build/linux/system.gyp:pangocairo',
206 # Needed to use the master_preferences functions
211 # 'branding' is a variable defined in common.gypi
212 # (e.g. "Chromium", "Chrome")
214 ['branding=="Chrome"', {
215 'mac_bundle_resources': [
216 'app/theme/google_chrome/mac/app.icns',
217 'app/theme/google_chrome/mac/document.icns',
218 'browser/ui/cocoa/applescript/scripting.sdef',
220 }, { # else: 'branding!="Chrome"
221 'mac_bundle_resources': [
222 'app/theme/chromium/mac/app.icns',
223 'app/theme/chromium/mac/document.icns',
224 'browser/ui/cocoa/applescript/scripting.sdef',
227 ['mac_breakpad==1', {
229 # A real .dSYM is needed for dump_syms to operate on.
233 # With mac_real_dsym set, strip_from_xcode won't be used.
234 # Specify CHROMIUM_STRIP_SAVE_FILE directly to Xcode.
235 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
238 '../breakpad/breakpad.gyp:dump_syms',
239 '../breakpad/breakpad.gyp:symupload',
241 # The "Dump Symbols" post-build step is in a target_conditions
242 # block so that it will follow the "Strip If Needed" step if that
243 # is also being used. There is no standard configuration where
244 # both of these steps occur together, but Mark likes to use this
245 # configuration sometimes when testing Breakpad-enabled builds
246 # without the time overhead of creating real .dSYM files. When
247 # both "Dump Symbols" and "Strip If Needed" are present, "Dump
248 # Symbols" must come second because "Strip If Needed" creates
249 # a fake .dSYM that dump_syms needs to fake dump. Since
250 # "Strip If Needed" is added in a target_conditions block in
251 # common.gypi, "Dump Symbols" needs to be in an (always true)
252 # target_conditions block.
253 'target_conditions': [
257 'postbuild_name': 'Dump Symbols',
259 'dump_product_syms_path':
260 'tools/build/mac/dump_product_syms',
262 'action': ['<(dump_product_syms_path)',
270 'product_name': '<(mac_product_name)',
272 # chrome/app/app-Info.plist has:
273 # CFBundleIdentifier of CHROMIUM_BUNDLE_ID
274 # CFBundleName of CHROMIUM_SHORT_NAME
275 # CFBundleSignature of CHROMIUM_CREATOR
276 # Xcode then replaces these values with the branded values we set
277 # as settings on the target.
278 'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
279 'CHROMIUM_CREATOR': '<(mac_creator)',
280 'CHROMIUM_SHORT_NAME': '<(branding)',
283 '../components/components.gyp:chrome_manifest_bundle',
285 'infoplist_strings_tool',
286 # On Mac, make sure we've built chrome_dll, which contains all of
287 # the library code with Chromium functionality.
290 'mac_bundle_resources': [
291 '<(PRODUCT_DIR)/<(mac_bundle_id).manifest',
295 # Generate the InfoPlist.strings file
296 'action_name': 'Generate InfoPlist.strings files',
298 'tool_path': '<(PRODUCT_DIR)/infoplist_strings_tool',
299 # Unique dir to write to so the [lang].lproj/InfoPlist.strings
300 # for the main app and the helper app don't name collide.
301 'output_path': '<(INTERMEDIATE_DIR)/app_infoplist_strings',
304 [ 'branding == "Chrome"', {
306 'branding_name': 'google_chrome_strings',
308 }, { # else branding!="Chrome"
310 'branding_name': 'chromium_strings',
317 # TODO: remove this helper when we have loops in GYP
318 '>!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))',
321 # TODO: remove this helper when we have loops in GYP
322 '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))',
326 '-b', '<(branding_name)',
327 '-v', '<(version_path)',
328 '-g', '<(grit_out_dir)',
329 '-o', '<(output_path)',
333 'message': 'Generating the language InfoPlist.strings files',
334 'process_outputs_as_mac_bundle_resources': 1,
339 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Versions/<(version_full)',
341 '<(PRODUCT_DIR)/<(mac_product_name) Helper.app',
347 'postbuild_name': 'Copy <(mac_product_name) Framework.framework',
349 '../build/mac/copy_framework_unversioned.sh',
350 '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Framework.framework',
351 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Versions/<(version_full)',
355 # Modify the Info.plist as needed. The script explains why this
356 # is needed. This is also done in the helper_app and chrome_dll
357 # targets. Use --breakpad=0 to not include any Breakpad
358 # information; that all goes into the framework's Info.plist.
359 # Keystone information is included if Keystone is enabled. The
360 # application reads Keystone keys from this plist and not the
361 # framework's, and the ticket will reference this Info.plist to
362 # determine the tag of the installed product. Use --scm=1 to
363 # include SCM information.
364 'postbuild_name': 'Tweak Info.plist',
365 'action': ['<(tweak_info_plist_path)',
367 '--keystone=<(mac_keystone)',
369 '--bundle_id=<(mac_bundle_id)'],
372 'postbuild_name': 'Clean up old versions',
374 'tools/build/mac/clean_up_old_versions',
379 # This postbuid step is responsible for creating the following
382 # For unofficial Chromium branding, Chromium Helper EH.app and
383 # Chromium Helper NP.app are created from Chromium Helper.app.
384 # For official Google Chrome branding, Google Chrome Helper
385 # EH.app and Google Chrome Helper NP.app are created from
386 # Google Chrome Helper.app.
388 # The EH helper is marked for an executable heap. The NP helper
389 # is marked for no PIE (ASLR).
391 # Normally, applications shipping as part of offical builds with
392 # Google Chrome branding have dsymutil (dwarf-with-dsym,
393 # mac_real_dsym) and dump_syms (mac_breakpad) run on them to
394 # produce a .dSYM bundle and a Breakpad .sym file. This is
395 # unnecessary for the "More Helpers" because they're identical
396 # to the original helper except for the bits in their Mach-O
397 # headers that change to enable or disable special features.
398 # Each .dSYM is identified by UUID stored in a Mach-O file's
399 # LC_UUID load command. Because the "More Helpers" share a UUID
400 # with the original helper, there's no need to run dsymutil
401 # again. All helpers can share the same .dSYM. Special handling
402 # is performed in chrome/tools/build/mac/dump_product_syms to
403 # prepare their Breakpad symbol files.
404 'postbuild_name': 'Make More Helpers',
406 '../build/mac/make_more_helpers.sh',
407 'Versions/<(version_full)',
408 '<(mac_product_name)',
412 # Make sure there isn't any Objective-C in the browser app's
414 'postbuild_name': 'Verify No Objective-C',
416 '../build/mac/verify_no_objc.sh',
423 # 'product_name': 'chromium'
424 # whenever we convert the rest of the infrastructure
425 # (buildbots etc.) to understand the branding gyp define.
426 # NOTE: chrome/app/theme/chromium/BRANDING and
427 # chrome/app/theme/google_chrome/BRANDING have the short name
428 # "chrome" etc.; should we try to extract from there instead?
430 # CrOS does this in a separate build step.
431 ['OS=="linux" and chromeos==0 and linux_dump_symbols==1', {
433 '../pdf/pdf.gyp:pdf_linux_symbols',
435 }], # OS=="linux" and chromeos==0 and linux_dump_symbols==1
436 # Android doesn't use pdfium.
439 # On Mac, this is done in chrome_dll.gypi.
440 '../pdf/pdf.gyp:pdf',
445 '../components/components.gyp:startup_metric_utils',
446 'chrome_resources.gyp:packed_extra_resources',
447 'chrome_resources.gyp:packed_resources',
448 # Copy Flash Player files to PRODUCT_DIR if applicable. Let the .gyp
449 # file decide what to do on a per-OS basis; on Mac, internal plugins
450 # go inside the framework, so this dependency is in chrome_dll.gypi.
451 '../third_party/adobe/flash/flash_player.gyp:flapper_binaries',
452 # Copy CDM files to PRODUCT_DIR if applicable. Let the .gyp
453 # file decide what to do on a per-OS basis; on Mac, internal plugins
454 # go inside the framework, so this dependency is in chrome_dll.gypi.
455 '../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
458 ['chrome_multiple_dll', {
459 'defines': ['CHROME_MULTIPLE_DLL'],
461 ['OS=="mac" and asan==1', {
463 # Override the outer definition of CHROMIUM_STRIP_SAVE_FILE.
464 'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
469 ['branding=="Chrome"', {
471 'linux_installer_configs',
474 # For now, do not build nacl_helper when disable_nacl=1
475 # http://code.google.com/p/gyp/issues/detail?id=239
476 ['disable_nacl==0', {
478 '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
479 '../components/nacl.gyp:nacl_helper',
484 '../sandbox/sandbox.gyp:sandbox',
491 'chrome_process_finder',
492 'chrome_version_resources',
495 '../base/base.gyp:base',
496 '../crypto/crypto.gyp:crypto',
497 '../breakpad/breakpad.gyp:breakpad_handler',
498 '../breakpad/breakpad.gyp:breakpad_sender',
499 '../chrome_elf/chrome_elf.gyp:chrome_elf',
500 '../components/components.gyp:crash_component',
501 '../sandbox/sandbox.gyp:sandbox',
504 'app/chrome_breakpad_client.cc',
505 'app/chrome_breakpad_client.h',
507 'common/crash_keys.cc',
508 'common/crash_keys.h',
509 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_exe_version.rc',
513 'ImportLibrary': '$(OutDir)\\lib\\chrome_exe.lib',
514 'OutputFile': '$(OutDir)\\initialexe\\chrome.exe',
522 'AdditionalDependencies': [
528 # Set /SUBSYSTEM:WINDOWS for chrome.exe itself, except for the
529 # AddressSanitizer build where console output is important.
535 'AdditionalManifestFiles': [
536 '$(ProjectDir)\\app\\chrome.exe.manifest',
537 '<(SHARED_INTERMEDIATE_DIR)/chrome/app/version_assembly/version_assembly.manifest',
542 ['configuration_policy==1', {
544 '<(DEPTH)/components/components.gyp:policy',
550 'action_name': 'first_run',
555 '<(PRODUCT_DIR)/First Run',
557 'action': ['python', '../build/cp.py', '<@(_inputs)', '<@(_outputs)'],
558 'message': 'Copy first run complete sentinel file',
561 'action_name': 'chrome_exe_manifest',
563 'app/version_assembly/chrome_exe_manifest_action.gypi',
567 'action_name': 'version_assembly_manifest',
569 'app/version_assembly/version_assembly_manifest_action.gypi',
575 'app/client_util.cc',
578 ['OS=="win" and component=="shared_library"', {
579 'defines': ['COMPILE_CONTENT_STATICALLY'],
583 '../win8/metro_driver/metro_driver.gyp:metro_driver',
584 '../win8/delegate_execute/delegate_execute.gyp:*',
594 'target_name': 'image_pre_reader',
595 'type': 'static_library',
597 'app/image_pre_reader_win.cc',
598 'app/image_pre_reader_win.h',
601 '../base/base.gyp:base',
606 ['disable_nacl!=1 and target_arch=="ia32"', {
609 'target_name': 'chrome_nacl_win64',
610 'type': 'executable',
611 'product_name': 'nacl64',
613 'app/chrome_breakpad_client.cc',
614 'common/crash_keys.cc',
615 'nacl/nacl_exe_win_64.cc',
616 '../content/app/startup_helper_win.cc',
617 '../content/common/sandbox_init_win.cc',
618 '../content/common/sandbox_win.cc',
619 '../content/public/common/content_switches.cc',
620 '../content/public/common/sandboxed_process_launcher_delegate.cc',
621 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/nacl64_exe_version.rc',
624 'chrome_version_resources',
625 'installer_util_nacl_win64',
626 '../base/base.gyp:base_i18n_nacl_win64',
627 '../base/base.gyp:base_win64',
628 '../base/base.gyp:base_static_win64',
629 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
630 '../breakpad/breakpad.gyp:breakpad_handler_win64',
631 '../breakpad/breakpad.gyp:breakpad_sender_win64',
632 '../components/components.gyp:breakpad_win64',
633 '../chrome/common_constants.gyp:common_constants_win64',
634 '../components/nacl.gyp:nacl_win64',
635 '../crypto/crypto.gyp:crypto_nacl_win64',
636 '../ipc/ipc.gyp:ipc_win64',
637 '../sandbox/sandbox.gyp:sandbox_win64',
640 '<@(nacl_win64_defines)',
641 'COMPILE_CONTENT_STATICALLY',
644 '<(SHARED_INTERMEDIATE_DIR)/chrome',
648 'ImportLibrary': '$(OutDir)\\lib\\nacl64_exe.lib',
649 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
654 'msvs_target_platform': 'x64',
658 ['configuration_policy==1', {
660 '<(DEPTH)/components/components.gyp:policy_win64',
666 }, { # else (disable_nacl==1)
669 'target_name': 'chrome_nacl_win64',
677 ['test_isolation_mode != "noop"', {
680 'target_name': 'chrome_run',
686 '../build/isolate.gypi',