blob: 528f4f6a0c707df5f42dfa9067d370c31f56b09d [file]
"""Recipe for building cast_service standalone executable."""
import os
from slave import base_recipe
from slave.step import gn_step
from slave.step import ninja_step
from slave.step import sanitizer_unittest_step
BUILD_CONFIGS = {
'cast_service_x64' : {
'build_args_product': 'displayassistant_x64_eng',
'build_args': 'enable_standalone_cast_service=true',
}
}
def GetValidBuildNames():
return list(BUILD_CONFIGS.keys())
def CreateRecipe(build_name: str, **kwargs):
config = BUILD_CONFIGS[build_name]
return CastServiceRecipe(build_name, config, **kwargs)
class CastServiceRecipe(base_recipe.BaseRecipe):
"""This recipe builds the cast_service standalone executable."""
def __init__(self, build_name, config, **kwargs):
base_recipe.BaseRecipe.__init__(
self, enable_build_accelerator=True, **kwargs)
self._config = config
self._build_name = build_name
def get_steps(self):
steps = []
cwd = os.getcwd()
setup_steps = self.get_setup_steps()
chromium_root = setup_steps[0].get_project_path('chromium/src')
out_dir = os.path.join(chromium_root,
'out_{}'.format(self._build_name),
'release')
gn_gen_step = gn_step.GnGenStep(
build_args_product=self._config['build_args_product'],
build_args=[self._config['build_args']],
out_dir=out_dir,
halt_on_failure=True,
cwd=cwd,
**self._step_kwargs
)
steps.append(gn_gen_step)
gn_args_step = gn_step.GnArgsStep(
out_dir=out_dir,
cwd=cwd,
halt_on_failure=True,
**self._step_kwargs
)
steps.append(gn_args_step)
ninja_build_step = ninja_step.NinjaStep(
out_dir=out_dir,
target='cast_service',
cwd=cwd,
jobs=64,
halt_on_failure=True,
**self._step_kwargs)
steps.append(ninja_build_step)
return steps