def webrtc_openh264(c): if c.TARGET_PLATFORM == 'ios': raise BadConf( 'ffmpeg decode not supported for iOS') # pragma: no cover if c.TARGET_PLATFORM == 'android': raise BadConf( 'h264 decode not supported for Android') # pragma: no cover c.gyp_env.GYP_DEFINES['ffmpeg_branding'] = 'Chrome' c.gyp_env.GYP_DEFINES['rtc_use_h264'] = 1
def libyuv_ios(c): if c.HOST_PLATFORM != 'mac': raise BadConf( 'Only "mac" host platform is supported for iOS (got: "%s")' % c.HOST_PLATFORM) # pragma: no cover if c.TARGET_PLATFORM != 'ios': raise BadConf('Only "ios" target platform is supported (got: "%s")' % c.TARGET_PLATFORM) # pragma: no cover c.build_config_fs = c.BUILD_CONFIG + '-iphoneos' c.gn_args.append('ios_enable_code_signing=false') c.gn_args.append('target_os="%s"' % c.TARGET_PLATFORM) _libyuv_common(c) _libyuv_static_build(c)
def tsan2(c): if 'clang' not in c.compile_py.compiler: # pragma: no cover raise BadConf('tsan2 requires clang') c.runtests.swarming_tags |= {'tsan:1'} gyp_defs = c.gyp_env.GYP_DEFINES gyp_defs['tsan'] = 1 gyp_defs['disable_nacl'] = 1
def chrome_golo(c): # pragma: no cover if not c.GIT_MODE: raise BadConf('chrome_golo only supports git') s = c.solutions.add() s.name = 'chrome_golo' s.url = 'https://chrome-internal.googlesource.com/chrome-golo/chrome-golo.git' c.got_revision_mapping['chrome_golo'] = 'got_revision'
def libyuv_ios(c): if c.HOST_PLATFORM != 'mac': raise BadConf( 'Only "mac" host platform is supported for iOS (got: "%s")' % c.HOST_PLATFORM) # pragma: no cover if c.TARGET_PLATFORM != 'ios': raise BadConf('Only "ios" target platform is supported (got: "%s")' % c.TARGET_PLATFORM) # pragma: no cover c.build_config_fs = c.BUILD_CONFIG + '-iphoneos' gyp_defs = c.gyp_env.GYP_DEFINES gyp_defs['OS'] = c.TARGET_PLATFORM if c.TARGET_BITS == 64: gyp_defs['target_subarch'] = 'arm64' _libyuv_common(c)
def syzyasan(c): if c.gyp_env.GYP_DEFINES[ 'component'] != 'static_library': # pragma: no cover raise BadConf('SyzyASan requires component=static_library') gyp_defs = c.gyp_env.GYP_DEFINES gyp_defs['win_z7'] = 1 gyp_defs['chromium_win_pch'] = 0
def build(c): if not c.GIT_MODE: # pragma: no cover raise BadConf('build only supports git') s = c.solutions.add() s.name = 'build' s.url = ChromiumGitURL(c, 'chromium', 'tools', 'build.git') m = c.got_revision_mapping m['build'] = 'got_revision'
def chromium_lkgr(c): s = c.solutions[0] safesync_url = 'https://chromium-status.appspot.com/lkgr' if c.GIT_MODE: # pragma: no cover safesync_url = 'https://chromium-status.appspot.com/git-lkgr' raise BadConf('Git has problems with safesync_url, crbug.com/109191.') s.safesync_url = safesync_url s.revision = 'origin/lkgr'
def skia(c): # pragma: no cover if not c.GIT_MODE: raise BadConf('skia only supports git') s = c.solutions.add() s.name = 'skia' s.url = 'https://skia.googlesource.com/skia.git' m = c.got_revision_mapping m['skia'] = 'got_revision'
def depot_tools(c): # pragma: no cover if not c.GIT_MODE: raise BadConf('depot_tools only supports git') s = c.solutions.add() s.name = 'depot_tools' s.url = ChromiumGitURL(c, 'chromium', 'tools', 'depot_tools.git') m = c.got_revision_mapping m['depot_tools'] = 'got_revision'
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 webrtc_ios(c): if c.HOST_PLATFORM != 'mac': raise BadConf('Only "mac" host platform is supported for iOS (got: "%s")' % c.HOST_PLATFORM) # pragma: no cover if c.TARGET_PLATFORM != 'ios': raise BadConf('Only "ios" target platform is supported (got: "%s")' % c.TARGET_PLATFORM) # pragma: no cover if c.TARGET_ARCH == 'arm': c.build_config_fs = c.BUILD_CONFIG + '-iphoneos' if c.TARGET_ARCH == 'intel': c.build_config_fs = c.BUILD_CONFIG + '-iphonesimulator' gyp_defs = c.gyp_env.GYP_DEFINES gyp_defs['build_with_libjingle'] = 1 gyp_defs['chromium_ios_signing'] = 0 gyp_defs['key_id'] = '' gyp_defs['OS'] = c.TARGET_PLATFORM _compiler_defaults(c)
def chromium_lkcr(c): # TODO(phajdan.jr): Add git hashes for LKCR crbug.com/349277. if c.GIT_MODE: raise BadConf('Git has problems with safesync_url and LKCR, ' 'crbug.com/349277 crbug.com/109191') # pragma: no cover s = c.solutions[0] s.safesync_url = 'https://build.chromium.org/p/chromium/lkcr-status/lkgr' # TODO(hinoka): Once lkcr exists and is a tag, it should just be lkcr # rather than origin/lkcr. s.revision = 'origin/lkcr'
def goma(c): 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) if c.TARGET_PLATFORM == 'win' and c.compile_py.compiler != 'goma-clang': fastbuild(c)
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 build_internal(c): if not c.GIT_MODE: # pragma: no cover raise BadConf('build_internal only supports git') s = c.solutions.add() s.name = 'build_internal' s.url = 'https://chrome-internal.googlesource.com/chrome/tools/build.git' c.got_revision_mapping['build_internal'] = 'got_revision' # We do not use 'includes' here, because we want build_internal to be the # first solution in the list as run_presubmit computes upstream revision # from the first solution. build(c) c.got_revision_mapping['build'] = 'got_build_revision'
def asan(c): if 'clang' not in c.compile_py.compiler: # pragma: no cover raise BadConf('asan requires clang') c.runtests.swarming_tags |= {'asan:1'} if c.TARGET_PLATFORM in ['mac', 'win']: # Set fastbuild=0 and prevent other configs from changing it. fastbuild(c, invert=True, optional=False) c.gyp_env.GYP_DEFINES['asan'] = 1 if c.TARGET_PLATFORM != 'android' and c.TARGET_BITS == 64: # LSAN isn't supported on Android or 32 bits platforms. c.gyp_env.GYP_DEFINES['lsan'] = 1
def goma(c): 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 = c.BUILD_PATH.join('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)
def oilpan(c): # pragma: no cover if c.GIT_MODE: raise BadConf("Oilpan requires SVN for now") c.solutions[0].custom_vars = { 'webkit_trunk': ChromiumSvnSubURL(c, 'blink', 'branches', 'oilpan') } c.solutions[0].custom_vars['sourceforge_url'] = mirror_only( c, 'svn://svn-mirror.golo.chromium.org/%(repo)s', 'svn://svn.chromium.org/%(repo)s') c.revisions['src/third_party/WebKit'] = 'HEAD' c.solutions[0].revision = '197341' c.solutions[0].custom_deps = { 'src/chrome/tools/test/reference_build/chrome_linux': ChromiumSvnSubURL(c, 'blink', 'branches', 'oilpan', 'Tools', 'reference_build', 'chrome_linux') } del c.got_revision_mapping['src'] c.got_revision_mapping['src/third_party/WebKit/Source'] = 'got_revision'
def webrtc_desktop_perf(c): if c.BUILD_CONFIG != 'Release': raise BadConf('Perf bots must use Release configs!') # pragma: no cover c.compile_py.default_targets = ['isac_fix_test', 'low_bandwidth_audio_test', 'webrtc_perf_tests']
def ubsan_vptr(c): if 'clang' not in c.compile_py.compiler: # pragma: no cover raise BadConf('ubsan_vptr requires clang') c.gn_args.append('is_ubsan_vptr=true') c.gyp_env.GYP_DEFINES['ubsan_vptr'] = 1
def msan(c): if 'clang' not in c.compile_py.compiler: # pragma: no cover raise BadConf('msan requires clang') c.runtests.swarming_tags |= {'msan:1'} c.gn_args.append('is_msan=true') c.gyp_env.GYP_DEFINES['msan'] = 1
def xcode(c): # pragma: no cover if c.HOST_PLATFORM != 'mac': raise BadConf('can not use xcodebuild on "%s"' % c.HOST_PLATFORM) c.gyp_env.GYP_GENERATORS.add('xcode')
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 = c.CHECKOUT_PATH.join('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.TARGET_PLATFORM == 'mac': c.env.FORCE_MAC_TOOLCHAIN = 1 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 ubsan(c): if 'clang' not in c.compile_py.compiler: # pragma: no cover raise BadConf('ubsan requires clang') c.gyp_env.GYP_DEFINES['ubsan'] = 1
def _memory_tool(c, tool): if tool not in MEMORY_TOOLS: # pragma: no cover raise BadConf('"%s" is not a supported memory tool, the supported ones ' 'are: %s' % (tool, ','.join(MEMORY_TOOLS))) c.runtests.memory_tool = tool
def webrtc_android_perf(c): if c.BUILD_CONFIG != 'Release': raise BadConf('Perf bots must use Release configs!') # pragma: no cover c.compile_py.default_targets = ['low_bandwidth_audio_test', 'webrtc_perf_tests', 'AppRTCMobileTestStubbedVideoIO']