def v8(c): targ_arch = c.gyp_env.GYP_DEFINES.get('target_arch') if not targ_arch: # pragma: no cover raise recipe_config.BadConf('v8 must have a valid target_arch.') c.gyp_env.GYP_DEFINES['v8_target_arch'] = targ_arch if c.TARGET_PLATFORM == 'android': c.gyp_env.GYP_DEFINES['OS'] = 'android' del c.gyp_env.GYP_DEFINES['component'] c.build_dir = Path('[CHECKOUT]', 'out') c.compile_py.build_tool = 'make' if c.HOST_PLATFORM == 'mac': c.compile_py.build_tool = 'xcode' elif c.HOST_PLATFORM == 'win': c.compile_py.build_tool = 'vs' c.build_dir = Path('[CHECKOUT]', 'build') if c.BUILD_CONFIG == 'Debug': c.gyp_env.GYP_DEFINES['v8_optimized_debug'] = 1 c.gyp_env.GYP_DEFINES['v8_enable_slow_dchecks'] = 1 # Chromium adds '_x64' to the output folder, which is only understood when # compiling v8 standalone with ninja. if c.HOST_PLATFORM == 'win' and c.TARGET_BITS == 64: c.build_config_fs = c.BUILD_CONFIG c.compile_py.pass_arch_flag = True
def android_common(c): gyp_defs = c.gyp_env.GYP_DEFINES gyp_defs['fastbuild'] = 1 gyp_defs['OS'] = 'android' c.env.PATH.extend([ Path('[CHECKOUT]', 'third_party', 'android_tools', 'sdk', 'platform-tools'), Path('[CHECKOUT]', 'build', 'android')])
def msvs(c): if c.HOST_PLATFORM != 'win': # pragma: no cover raise BadConf('can not use msvs on "%s"' % c.HOST_PLATFORM) # If compile.py is invoking devenv it needs to refer to a solution file. # For chrome this defaults to ['CHECKOUT']/build/all.sln. c.compile_py.solution = Path('[CHECKOUT]', 'build', 'all.sln') c.gyp_env.GYP_GENERATORS.add('msvs') c.compile_py.build_tool = 'vs' c.build_dir = Path('[CHECKOUT]', 'build')
def BaseConfig(INTERNAL=False, REPO_NAME=None, REPO_URL=None, BUILD_CONFIG='Debug', REVISION='', **_kwargs): return ConfigGroup( INTERNAL=Static(INTERNAL), REPO_NAME=Static(REPO_NAME), REPO_URL=Static(REPO_URL), BUILD_CONFIG=Static(BUILD_CONFIG), revision=Single(basestring, empty_val=REVISION), revisions=Dict(value_type=(basestring, types.NoneType)), asan_symbolize=Single(bool, required=False, empty_val=False), get_app_manifest_vars=Single(bool, required=False, empty_val=True), run_tree_truth=Single(bool, required=False, empty_val=True), deps_file=Single(basestring, required=False, empty_val='.DEPS.git'), internal_dir_name=Single(basestring, required=False), # deps_dir: where to checkout the gclient deps file deps_dir=Single(basestring, required=False, empty_val=REPO_NAME), managed=Single(bool, required=False, empty_val=True), extra_deploy_opts=List(inner_type=basestring), tests=List(inner_type=basestring), cr_build_android=Static(Path('[CHECKOUT]', 'build', 'android')), test_runner=Single(Path), gclient_custom_deps=Dict(value_type=(basestring, types.NoneType)), channel=Single(basestring, empty_val='chrome'), gclient_custom_vars=Dict(value_type=(basestring, types.NoneType)), coverage=Single(bool, required=False, empty_val=False), chrome_specific_wipe=Single(bool, required=False, empty_val=False), incremental_coverage=Single(bool, required=False, empty_val=False), env=ConfigGroup(LLVM_FORCE_HEAD_REVISION=Single(basestring, required=False), ), )
def webrtc_standalone(c): _compiler_defaults(c) c.runtests.memory_tests_runner = Path('[CHECKOUT]', 'tools', 'valgrind-webrtc', 'webrtc_tests', platform_ext={'win': '.bat', 'mac': '.sh', 'linux': '.sh'})
def ninja(c): if c.TARGET_PLATFORM == 'ios': c.gyp_env.GYP_GENERATORS.add('ninja') c.compile_py.build_tool = 'ninja' out_path = 'out' if c.TARGET_CROS_BOARD: out_path += '_%s' % (c.TARGET_CROS_BOARD, ) c.build_dir = Path('[CHECKOUT]', out_path)
def libyuv(c): _libyuv_common(c) c.runtests.memory_tests_runner = Path('[CHECKOUT]', 'tools', 'valgrind-libyuv', 'libyuv_tests', platform_ext={ 'win': '.bat', 'mac': '.sh', 'linux': '.sh' })
def BaseConfig(USE_MIRROR=False): chromium_in_android_subpath = ('external', 'chromium_org') build_path = Path('[SLAVE_BUILD]', 'android-src') return ConfigGroup( lunch_flavor=Single(basestring), repo=ConfigGroup( url=Single(basestring), branch=Single(basestring), sync_flags=List(basestring), ), USE_MIRROR=Static(bool(USE_MIRROR)), # If present causes the sync step to use the specified manifest instead of # the one associated with the repo.branch. sync_manifest_override=Single(Path, required=False), # Path stuff chromium_in_android_subpath=Static( '/'.join(chromium_in_android_subpath)), build_path=Static(build_path), slave_chromium_in_android_path=Static( build_path.join(*chromium_in_android_subpath)), slave_android_out_path=Static(build_path.join('out')), )
def goma(c): if c.compile_py.build_tool == 'vs': # pragma: no cover raise BadConf('goma doesn\'t work with msvs') if not c.compile_py.compiler: c.compile_py.compiler = 'goma' elif c.compile_py.compiler == 'clang': c.compile_py.compiler = 'goma-clang' else: # pragma: no cover raise BadConf('goma config doesn\'t understand %s' % c.compile_py.compiler) c.gyp_env.GYP_DEFINES['use_goma'] = 1 goma_dir = Path('[BUILD]', 'goma') c.gyp_env.GYP_DEFINES['gomadir'] = goma_dir c.compile_py.goma_dir = goma_dir if c.TARGET_PLATFORM == 'win' and c.compile_py.compiler != 'goma-clang': fastbuild(c) pch(c, invert=True)
def chromium_xcode(c): # pragma: no cover c.compile_py.build_tool = 'xcode' c.compile_py.default_targets = ['All'] c.compile_py.xcode_project = Path('[CHECKOUT]', 'build', 'all.xcodeproj')
def make(c): c.build_dir = Path('[CHECKOUT]', 'out') c.compile_py.build_tool = 'make'
def AOSP_webview(c): c.sync_manifest_override = Path('[CHECKOUT]', 'android_webview', 'buildbot', 'aosp_manifest.xml')
def base_config(c): c.internal_dir_name = 'clank' c.test_runner = Path('[CHECKOUT]', 'build', 'android', 'test_runner.py')
# Copyright 2014 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. import DEPS CONFIG_CTX = DEPS['chromium'].CONFIG_CTX from recipe_engine.config_types import Path SYZYGY_SLN = Path('[CHECKOUT]', 'syzygy', 'syzygy.sln') # The common bits of configuration shared across all valid Syzygy # configurations. This is included in _syzygy_msvs and _syzygy_ninja, # exactly one of which is included in each valid usable configuration. @CONFIG_CTX(includes=['msvs2013']) def _syzygy_base(c): c.project_generator.tool = 'gyp' # We don't use a component build, so remove the GYP define. c.gyp_env.GYP_DEFINES.pop('component', None) @CONFIG_CTX(includes=['msvs', '_syzygy_base']) def _syzygy_msvs(dummy_c): pass @CONFIG_CTX(includes=['ninja', '_syzygy_base']) def _syzygy_ninja(c):
def embed_script_mjsunit(c): c.gyp_env.GYP_DEFINES['embed_script'] = Path( '[CHECKOUT]', 'test', 'mjsunit', 'mjsunit.js')
def BASE(c): host_targ_tuples = [(c.HOST_PLATFORM, c.HOST_ARCH, c.HOST_BITS), (c.TARGET_PLATFORM, c.TARGET_ARCH, c.TARGET_BITS)] for (plat, arch, bits) in host_targ_tuples: if plat == 'ios': if arch not in ('arm', 'intel'): # pragma: no cover raise BadConf('%s/%s arch is not supported on %s' % (arch, bits, plat)) elif plat in ('win', 'mac'): if arch != 'intel': # pragma: no cover raise BadConf('%s arch is not supported on %s' % (arch, plat)) elif plat in ('chromeos', 'android', 'linux'): pass # no arch restrictions else: # pragma: no cover assert False, "Not covering a platform: %s" % plat potential_platforms = { # host -> potential target platforms 'win': ('win', ), 'mac': ('mac', 'ios'), 'linux': ('linux', 'chromeos', 'android'), }.get(c.HOST_PLATFORM) if not potential_platforms: # pragma: no cover raise BadConf('Cannot build on "%s"' % c.HOST_PLATFORM) if c.TARGET_PLATFORM not in potential_platforms: raise BadConf('Can not compile "%s" on "%s"' % (c.TARGET_PLATFORM, c.HOST_PLATFORM)) # pragma: no cover if c.TARGET_CROS_BOARD: if not c.TARGET_PLATFORM == 'chromeos': # pragma: no cover raise BadConf( "Cannot specify CROS board for non-'chromeos' platform") if c.HOST_PLATFORM != c.TARGET_PLATFORM or c.HOST_ARCH != c.TARGET_ARCH: c.gyp_env.GYP_CROSSCOMPILE = 1 if c.HOST_BITS < c.TARGET_BITS: raise BadConf('host bits < targ bits') # pragma: no cover c.build_config_fs = c.BUILD_CONFIG if c.HOST_PLATFORM == 'win': if c.TARGET_BITS == 64: # Windows requires 64-bit builds to be in <dir>_x64. c.build_config_fs = c.BUILD_CONFIG + '_x64' # Test runner memory tools that are not compile-time based. c.runtests.memory_tests_runner = Path('[CHECKOUT]', 'tools', 'valgrind', 'chrome_tests', platform_ext={ 'win': '.bat', 'mac': '.sh', 'linux': '.sh' }) if c.project_generator.tool not in PROJECT_GENERATORS: # pragma: no cover raise BadConf('"%s" is not a supported project generator tool, the ' 'supported ones are: %s' % (c.project_generator.tool, ','.join(PROJECT_GENERATORS))) gyp_arch = { ('intel', 32): 'ia32', ('intel', 64): 'x64', ('arm', 32): 'arm', ('arm', 64): 'arm64', ('mips', 32): 'mips', ('mips', 64): 'mips64', ('mipsel', 32): 'mipsel', ('mipsel', 64): 'mips64el', }.get((c.TARGET_ARCH, c.TARGET_BITS)) if gyp_arch: c.gyp_env.GYP_DEFINES['target_arch'] = gyp_arch if c.BUILD_CONFIG in ['Coverage', 'Release']: # The 'Coverage' target is not explicitly used by Chrome, but by some other # projects in the Chrome ecosystem (ie: Syzygy). static_library(c, final=False) elif c.BUILD_CONFIG == 'Debug': shared_library(c, final=False) else: # pragma: no cover raise BadConf('Unknown build config "%s"' % c.BUILD_CONFIG)
def kasko_official(c): c.official_build = True c.unittests_gypi = Path('[CHECKOUT]', 'syzygy', 'kasko', 'unittests.gypi') c.version_file = Path('[CHECKOUT]', 'syzygy', 'kasko', 'VERSION')
def syzygy_official(c): c.official_build = True c.unittests_gypi = Path('[CHECKOUT]', 'syzygy', 'unittests.gypi') c.version_file = Path('[CHECKOUT]', 'syzygy', 'SYZYGY_VERSION')
def test(c): # pragma: no cover c.name = 'test' c.cmd = [Path('[CHECKOUT]', 'build', 'tools', 'cool_script.py')]
def __getitem__(self, name): return Path(NamedBasePath(name))
def webrtc(c): c.test_runner = Path('[CHECKOUT]', 'webrtc', 'build', 'android', 'test_runner.py')