Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions | Variables
build.cmake Namespace Reference

Functions

 compile_fn (api, checkout_root, _ignore)
 
 copy_build_products (api, src, dst)
 

Variables

str DOCKER_IMAGE = 'gcr.io/skia-public/cmake-release:3.13.4_v4'
 
str INNER_BUILD_SCRIPT = '/SRC/skia/infra/cmake/build_skia.sh'
 

Function Documentation

◆ compile_fn()

build.cmake.compile_fn (   api,
  checkout_root,
  _ignore 
)

Definition at line 11 of file cmake.py.

11def compile_fn(api, checkout_root, _ignore):
12 out_dir = api.vars.cache_dir.join('docker', 'cmake')
13 configuration = api.vars.builder_cfg.get('configuration', '')
14 if configuration != 'Release': # pragma: nocover
15 # If a debug mode is wanted, update the infra/cmake/build_skia.sh
16 # to support that also.
17 raise 'Only Release mode supported for CMake'
18
19 # We want to make sure the directories exist and were created by chrome-bot,
20 # because if that isn't the case, docker will make them and they will be
21 # owned by root, which causes mysterious failures. To mitigate this risk
22 # further, we don't use the same out_dir as everyone else (thus the _ignore)
23 # param. Instead, we use a "cmake" subdirectory in the "docker" named_cache.
24 api.file.ensure_directory('mkdirs out_dir', out_dir, mode=0o777)
25
26 # This uses the cmake docker image and says "run the
27 # build_skia.sh helper script in there". Additionally, it binds two
28 # folders: the Skia checkout to /SRC and the output directory to /OUT
29 # The called helper script will make the compile happen and put the
30 # output in the right spot. The neat thing is that since the Skia checkout
31 # (and, by extension, the build script) is not a part of the image, but
32 # bound in at runtime, we don't have to re-build the image, except when the
33 # toolchain changes.
34 cmd = ['docker', 'run', '--rm', '--volume', '%s:/SRC' % checkout_root,
35 '--volume', '%s:/OUT' % out_dir,
36 DOCKER_IMAGE, INNER_BUILD_SCRIPT]
37 # It's always Release mode (for now?) This is mostly an FYI
38 # thing, to make sure we don't break CMake users.
39
40 # Override DOCKER_CONFIG set by Kitchen.
41 env = {'DOCKER_CONFIG': '/home/chrome-bot/.docker'}
42 with api.env(env):
43 api.run(
44 api.step,
45 'Build Skia using CMake in Docker',
46 cmd=cmd)
47

◆ copy_build_products()

build.cmake.copy_build_products (   api,
  src,
  dst 
)

Definition at line 48 of file cmake.py.

48def copy_build_products(api, src, dst):
49 util.copy_listed_files(api, src, dst, util.DEFAULT_BUILD_PRODUCTS)

Variable Documentation

◆ DOCKER_IMAGE

str build.cmake.DOCKER_IMAGE = 'gcr.io/skia-public/cmake-release:3.13.4_v4'

Definition at line 7 of file cmake.py.

◆ INNER_BUILD_SCRIPT

str build.cmake.INNER_BUILD_SCRIPT = '/SRC/skia/infra/cmake/build_skia.sh'

Definition at line 8 of file cmake.py.