# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, 'variables': { 'version_py_path': 'tools/build/version.py', 'version_path': 'VERSION', }, 'version_py_path': '<(version_py_path)', 'version_path': '<(version_path)', 'version_full': '!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(RULE_INPUT_ROOT)_ZZLOCALE.pak\' <(locales))', # TODO(bradnelson): move to something like this #'.grd have slightly different outputs, so it # can't use chrome_strings rules above. 'target_name': 'platform_locale_settings', 'type': 'none', 'actions': [ { 'action_name': 'platform_locale_settings', 'variables': { 'input_path': '<(platform_locale_settings_grd)', 'conditions': [ ['branding=="Chrome"', { # TODO(mmoss) The .grd files look for _google_chrome, but for # consistency they should look for GOOGLE_CHROME_BUILD like C++. # Clean this up when Windows moves to gyp. 'chrome_build': '_google_chrome', }, { # else: branding!="Chrome" 'chrome_build': '_chromium', }], ], }, 'inputs': [ '!@(<(apply_locales_cmd) \'<(grit_out_dir)/<(branding_name)_ZZLOCALE.pak\' <(locales))', ], 'outputs': [ # TODO: remove this helper when we have loops in GYP '>!@(<(apply_locales_cmd) -d \'<(output_path)/ZZLOCALE.lproj/InfoPlist.strings\' <(locales))', ], 'action': [ '<(tool_path)', '-b', '<(branding_name)', '-v', '<(version_path)', '-g', '<(grit_out_dir)', '-o', '<(output_path)', '-t', 'helper', '<@(locales)', ], 'message': 'Generating the language InfoPlist.strings files', 'process_outputs_as_mac_bundle_resources': 1, }, ], 'postbuilds': [ { # The framework (chrome_dll) defines its load-time path # (DYLIB_INSTALL_NAME_BASE) relative to the main executable # (chrome). A different relative path needs to be used in # helper_app. 'postbuild_name': 'Fix Framework Link', 'action': [ 'install_name_tool', '-change', '@executable_path/../Versions/<(version_full)/<(mac_product_name) Framework.framework/<(mac_product_name) Framework', '@executable_path/../../../<(mac_product_name) Framework.framework/<(mac_product_name) Framework', '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}' ], }, { # Modify the Info.plist as needed. The script explains why this # is needed. This is also done in the chrome and chrome_dll # targets. In this case, -b0, -k0, and -s0 are used because # Breakpad, Keystone, and Subersion keys are never placed into # the helper. 'postbuild_name': 'Tweak Info.plist', 'action': ['<(tweak_info_plist_path)', '-b0', '-k0', '-s0', '<(branding)', '<(mac_bundle_id)'], }, ], 'conditions': [ ['mac_breakpad==1', { 'variables': { # A real .dSYM is needed for dump_syms to operate on. 'mac_real_dsym': 1, }, }], ], }, # target helper_app { # This produces the app mode loader, but not as a bundle. Chromium # itself is responsible for producing bundles. 'target_name': 'app_mode_app', 'type': 'executable', 'product_name': '<(mac_product_name) App Mode Loader', 'sources': [ 'app/app_mode_loader_mac.mm', 'common/app_mode_common_mac.h', 'common/app_mode_common_mac.mm', ], 'include_dirs': [ '..', ], 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', ], }, }, # target app_mode_app { # Convenience target to build a disk image. 'target_name': 'build_app_dmg', # Don't place this in the 'all' list; most won't want it. # In GYP, booleans are 0/1, not True/False. 'suppress_wildcard': 1, 'type': 'none', 'dependencies': [ 'chrome', ], 'variables': { 'build_app_dmg_script_path': 'tools/build/mac/build_app_dmg', }, 'actions': [ { 'inputs': [ '<(build_app_dmg_script_path)', '<(PRODUCT_DIR)/<(branding).app', ], 'outputs': [ '<(PRODUCT_DIR)/<(branding).dmg', ], 'action_name': 'build_app_dmg', 'action': ['<(build_app_dmg_script_path)', '<@(branding)'], }, ], # 'actions' }, { # Dummy target to allow chrome to require plugin_carbon_interpose to # build without actually linking to the resulting library. 'target_name': 'interpose_dependency_shim', 'type': 'executable', 'dependencies': [ 'plugin_carbon_interpose', ], # In release, we end up with a strip step that is unhappy if there is # no binary. Rather than check in a new file for this temporary hack, # just generate a source file on the fly. 'actions': [ { 'action_name': 'generate_stub_main', 'process_outputs_as_sources': 1, 'inputs': [], 'outputs': [ '<(INTERMEDIATE_DIR)/dummy_main.c' ], 'action': [ 'bash', '-c', 'echo "int main() { return 0; }" > <(INTERMEDIATE_DIR)/dummy_main.c' ], }, ], }, { # dylib for interposing Carbon calls in the plugin process. 'target_name': 'plugin_carbon_interpose', 'type': 'shared_library', 'dependencies': [ 'chrome_dll', ], 'sources': [ 'browser/plugin_carbon_interpose_mac.cc', ], 'include_dirs': [ '..', ], 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', ], }, 'xcode_settings': { 'DYLIB_COMPATIBILITY_VERSION': '<(version_mac_dylib)', 'DYLIB_CURRENT_VERSION': '<(version_mac_dylib)', 'DYLIB_INSTALL_NAME_BASE': '@executable_path', }, 'postbuilds': [ { # The framework (chrome_dll) defines its load-time path # (DYLIB_INSTALL_NAME_BASE) relative to the main executable # (chrome). A different relative path needs to be used in # plugin_carbon_interpose, which runs in the helper_app. 'postbuild_name': 'Fix Framework Link', 'action': [ 'install_name_tool', '-change', '@executable_path/../Versions/<(version_full)/<(mac_product_name) Framework.framework/<(mac_product_name) Framework', '@executable_path/../../../<(mac_product_name) Framework.framework/<(mac_product_name) Framework', '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}' ], }, ], }, { 'target_name': 'infoplist_strings_tool', 'type': 'executable', 'dependencies': [ 'chrome_strings', '../base/base.gyp:base', ], 'include_dirs': [ '<(grit_out_dir)', ], 'sources': [ 'tools/mac_helpers/infoplist_strings_util.mm', ], }, ], # targets }, { # else: OS != "mac" 'targets': [ { 'target_name': 'convert_dict', 'type': 'executable', 'msvs_guid': '42ECD5EC-722F-41DE-B6B8-83764C8016DF', 'dependencies': [ '../base/base.gyp:base', '../base/base.gyp:base_i18n', 'convert_dict_lib', '../third_party/hunspell/hunspell.gyp:hunspell', ], 'sources': [ 'tools/convert_dict/convert_dict.cc', ], }, { 'target_name': 'convert_dict_lib', 'product_name': 'convert_dict', 'type': 'static_library', 'msvs_guid': '1F669F6B-3F4A-4308-E496-EE480BDF0B89', 'include_dirs': [ '..', ], 'sources': [ 'tools/convert_dict/aff_reader.cc', 'tools/convert_dict/aff_reader.h', 'tools/convert_dict/dic_reader.cc', 'tools/convert_dict/dic_reader.h', 'tools/convert_dict/hunspell_reader.cc', 'tools/convert_dict/hunspell_reader.h', ], }, { 'target_name': 'flush_cache', 'type': 'executable', 'msvs_guid': '4539AFB3-B8DC-47F3-A491-6DAC8FD26657', 'dependencies': [ '../base/base.gyp:base', '../base/base.gyp:test_support_base', ], 'sources': [ 'tools/perf/flush_cache/flush_cache.cc', ], }, { # Mac needs 'process_outputs_as_mac_bundle_resources' to be set, # and the option is only effective when the target type is native # binary. Hence we cannot build the Mac bundle resources here and # the action is duplicated in chrome_dll.gypi. 'target_name': 'packed_extra_resources', 'type': 'none', 'variables': { 'repack_path': '../tools/data_pack/repack.py', }, 'dependencies': [ 'chrome_extra_resources', ], 'actions': [ { 'action_name': 'repack_resources', 'variables': { 'pak_inputs': [ '<(grit_out_dir)/bookmark_manager_resources.pak', '<(grit_out_dir)/net_internals_resources.pak', '<(grit_out_dir)/shared_resources.pak', ], }, 'inputs': [ '<(repack_path)', '<@(pak_inputs)', ], 'outputs': [ '<(PRODUCT_DIR)/resources.pak', ], 'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'], }, ] } ], },], # OS!="mac" ['OS=="linux"', { 'targets': [ { 'target_name': 'linux_symbols', 'type': 'none', 'conditions': [ ['linux_dump_symbols==1', { 'actions': [ { 'action_name': 'dump_symbols', 'inputs': [ '<(DEPTH)/build/linux/dump_app_syms', '<(DEPTH)/build/linux/dump_signature.py', '<(PRODUCT_DIR)/dump_syms', '<(PRODUCT_DIR)/chrome', ], 'outputs': [ '<(PRODUCT_DIR)/chrome.breakpad.<(target_arch)', ], 'action': ['<(DEPTH)/build/linux/dump_app_syms', '<(PRODUCT_DIR)/dump_syms', '<(linux_strip_binary)', '<(PRODUCT_DIR)/chrome', '<@(_outputs)'], 'message': 'Dumping breakpad symbols to <(_outputs)', 'process_outputs_as_sources': 1, }, ], 'dependencies': [ 'chrome', '../breakpad/breakpad.gyp:dump_syms', ], }], ['linux_strip_reliability_tests==1', { 'actions': [ { 'action_name': 'strip_reliability_tests', 'inputs': [ '<(PRODUCT_DIR)/automated_ui_tests', '<(PRODUCT_DIR)/reliability_tests', '<(PRODUCT_DIR)/lib.target/_pyautolib.so', ], 'outputs': [ '<(PRODUCT_DIR)/strip_reliability_tests.stamp', ], 'action': ['strip', '-g', '<@(_inputs)'], 'message': 'Stripping reliability tests', }, ], 'dependencies': [ 'automated_ui_tests', 'reliability_tests', ], }], ], } ], },], # OS=="linux" ['OS=="win"', { 'targets': [ { # TODO(sgk): remove this when we change the buildbots to # use the generated build\all.sln file to build the world. 'target_name': 'pull_in_all', 'type': 'none', 'dependencies': [ 'installer/mini_installer.gyp:*', '../app/app.gyp:*', '../base/base.gyp:*', '../chrome_frame/chrome_frame.gyp:*', '../gfx/gfx.gyp:*', '../ipc/ipc.gyp:*', '../media/media.gyp:*', '../net/net.gyp:*', '../printing/printing.gyp:*', '../sdch/sdch.gyp:*', '../skia/skia.gyp:*', '../testing/gmock.gyp:*', '../testing/gtest.gyp:*', '../third_party/bsdiff/bsdiff.gyp:*', '../third_party/bspatch/bspatch.gyp:*', '../third_party/bzip2/bzip2.gyp:*', '../third_party/codesighs/codesighs.gyp:*', '../third_party/icu/icu.gyp:*', '../third_party/libjpeg/libjpeg.gyp:*', '../third_party/libwebp/libwebp.gyp:*', '../third_party/libpng/libpng.gyp:*', '../third_party/libxslt/libxslt.gyp:*', '../third_party/lzma_sdk/lzma_sdk.gyp:*', '../third_party/modp_b64/modp_b64.gyp:*', '../third_party/npapi/npapi.gyp:*', '../third_party/ppapi/ppapi.gyp:*', '../third_party/sqlite/sqlite.gyp:*', '../third_party/zlib/zlib.gyp:*', '../webkit/support/webkit_support.gyp:*', '../webkit/webkit.gyp:*', '../build/temp_gyp/googleurl.gyp:*', '../breakpad/breakpad.gyp:*', '../courgette/courgette.gyp:*', '../gears/gears.gyp:*', '../rlz/rlz.gyp:*', '../sandbox/sandbox.gyp:*', '../tools/memory_watcher/memory_watcher.gyp:*', '../v8/tools/gyp/v8.gyp:v8_shell', ], 'conditions': [ ['win_use_allocator_shim==1', { 'dependencies': [ '../base/allocator/allocator.gyp:*', ], }], ], }, { 'target_name': 'chrome_dll_version', 'type': 'none', #'msvs_guid': '414D4D24-5D65-498B-A33F-3A29AD3CDEDC', 'dependencies': [ '../build/util/build_util.gyp:lastchange', ], 'direct_dependent_settings': { 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)/chrome_dll_version', ], }, 'actions': [ { 'action_name': 'version', 'variables': { 'lastchange_path': '<(SHARED_INTERMEDIATE_DIR)/build/LASTCHANGE', 'template_input_path': 'app/chrome_dll_version.rc.version', }, 'conditions': [ [ 'branding == "Chrome"', { 'variables': { 'branding_path': 'app/theme/google_chrome/BRANDING', }, }, { # else branding!="Chrome" 'variables': { 'branding_path': 'app/theme/chromium/BRANDING', }, }], ], 'inputs': [ '<(template_input_path)', '<(version_path)', '<(branding_path)', '<(lastchange_path)', ], 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/chrome_dll_version/chrome_dll_version.rc', ], 'action': [ 'python', '<(version_py_path)', '-f', '<(version_path)', '-f', '<(branding_path)', '-f', '<(lastchange_path)', '<(template_input_path)', '<@(_outputs)', ], 'message': 'Generating version information in <(_outputs)' }, ], }, { 'target_name': 'chrome_version_header', 'type': 'none', 'dependencies': [ '../build/util/build_util.gyp:lastchange', ], 'actions': [ { 'action_name': 'version_header', 'variables': { 'lastchange_path': '<(SHARED_INTERMEDIATE_DIR)/build/LASTCHANGE', }, 'conditions': [ [ 'branding == "Chrome"', { 'variables': { 'branding_path': 'app/theme/google_chrome/BRANDING', }, }, { # else branding!="Chrome" 'variables': { 'branding_path': 'app/theme/chromium/BRANDING', }, }], ], 'inputs': [ '<(version_path)', '<(branding_path)', '<(lastchange_path)', 'version.h.in', ], 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/version.h', ], 'action': [ 'python', '<(version_py_path)', '-f', '<(version_path)', '-f', '<(branding_path)', '-f', '<(lastchange_path)', 'version.h.in', '<@(_outputs)', ], 'message': 'Generating version header file: <@(_outputs)', }, ], }, { 'target_name': 'automation', 'type': '<(library)', 'msvs_guid': '1556EF78-C7E6-43C8-951F-F6B43AC0DD12', 'dependencies': [ 'theme_resources', '../skia/skia.gyp:skia', '../testing/gtest.gyp:gtest', ], 'include_dirs': [ '..', ], 'sources': [ 'test/automation/autocomplete_edit_proxy.cc', 'test/automation/autocomplete_edit_proxy.h', 'test/automation/automation_constants.h', 'test/automation/automation_handle_tracker.cc', 'test/automation/automation_handle_tracker.h', 'test/automation/automation_messages.cc', 'test/automation/automation_messages.h', 'test/automation/automation_messages_internal.h', 'test/automation/automation_proxy.cc', 'test/automation/automation_proxy.h', 'test/automation/browser_proxy.cc', 'test/automation/browser_proxy.h', 'test/automation/dom_element_proxy.cc', 'test/automation/dom_element_proxy.h', 'test/automation/extension_proxy.cc', 'test/automation/extension_proxy.h', 'test/automation/javascript_execution_controller.cc', 'test/automation/javascript_execution_controller.h', 'test/automation/tab_proxy.cc', 'test/automation/tab_proxy.h', 'test/automation/window_proxy.cc', 'test/automation/window_proxy.h', ], }, { 'target_name': 'crash_service', 'type': 'executable', 'msvs_guid': '89C1C190-A5D1-4EC4-BD6A-67FF2195C7CC', 'dependencies': [ 'common_constants', 'installer_util', '../base/base.gyp:base', '../breakpad/breakpad.gyp:breakpad_handler', '../breakpad/breakpad.gyp:breakpad_sender', ], 'include_dirs': [ '..', ], 'sources': [ 'tools/crash_service/crash_service.cc', 'tools/crash_service/crash_service.h', 'tools/crash_service/main.cc', ], 'msvs_settings': { 'VCLinkerTool': { 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS }, }, }, { 'target_name': 'generate_profile', 'type': 'executable', 'msvs_guid': '2E969AE9-7B12-4EDB-8E8B-48C7AE7BE357', 'dependencies': [ 'browser', 'renderer', 'syncapi', '../base/base.gyp:base', '../skia/skia.gyp:skia', ], 'include_dirs': [ '..', ], 'sources': [ 'tools/profiles/generate_profile.cc', 'tools/profiles/thumbnail-inl.h', ], 'conditions': [ ['OS=="win"', { 'conditions': [ ['win_use_allocator_shim==1', { 'dependencies': [ '<(allocator_target)', ], }], ], 'configurations': { 'Debug_Base': { 'msvs_settings': { 'VCLinkerTool': { 'LinkIncremental': '<(msvs_large_module_debug_link_mode)', }, }, }, }, }], ], }, ]}, # 'targets' ], # OS=="win" ['OS=="win" or OS=="mac" or OS=="linux"', { 'targets': [ { # policy_templates has different inputs and outputs, so it can't use # the rules of chrome_strings 'target_name': 'policy_templates', 'type': 'none', 'variables': { 'grd_path': 'app/policy/policy_templates.grd', 'template_files': [ '!@(<(repack_locales_cmd) -i <(branding_flag) -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))', ], 'outputs': [ '>!@(<(repack_locales_cmd) -o -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))', ], 'action': [ '<@(repack_locales_cmd)', '<@(branding_flag)', '-g', '<(grit_out_dir)', '-s', '<(SHARED_INTERMEDIATE_DIR)', '-x', '<(INTERMEDIATE_DIR)', '<@(locales)', ], }, ], # We'll install the resource files to the product directory. 'copies': [ { 'destination': '<(PRODUCT_DIR)/locales', 'files': [ '>!@(<(repack_locales_cmd) -o -g \'<(grit_out_dir)\' -s \'<(SHARED_INTERMEDIATE_DIR)\' -x \'<(INTERMEDIATE_DIR)\' <(locales))', ], }, { 'destination': '<(PRODUCT_DIR)', 'files': [ '<(INTERMEDIATE_DIR)/repack/chrome.pak' ], }, ], }], # targets }], # OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" ], # 'conditions' } # Local Variables: # tab-width:2 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=2 shiftwidth=2: