19 compiler = api.vars.builder_cfg.get('compiler', '')
20 configuration = api.vars.builder_cfg.get('configuration', '')
21 extra_tokens = api.vars.extra_tokens
22 extra_tokens.remove('Docker')
23 os = api.vars.builder_cfg.get('os', '')
24 target_arch = api.vars.builder_cfg.get('target_arch', '')
25
26 args = {
27 'extra_cflags': [],
28 'extra_ldflags': [],
29 'target_cpu': target_arch,
30 'werror': True
31 }
32
33 if configuration == 'Debug':
34 args[
'extra_cflags'].
append(
'-O1')
35 else:
36 args['is_debug'] = False
37
38 if 'NoGPU' in extra_tokens:
39 args['skia_enable_ganesh'] = False
40 extra_tokens.remove('NoGPU')
41 if 'Shared' in extra_tokens:
42 args['is_component_build'] = True
43 extra_tokens.remove('Shared')
44
45 image_name = None
46 if os == 'Debian11' and compiler == 'GCC' and not extra_tokens:
47 args['cc'] = 'gcc'
48 args['cxx'] = 'g++'
49
50
51
52 args[
'extra_cflags'].
append(
'-g1')
53 if target_arch == 'x86_64':
54 image_name = 'gcc-debian11'
55 elif target_arch == 'x86':
56 image_name = 'gcc-debian11-x86'
57
58 if not image_name:
59 raise Exception('Not implemented: ' + api.vars.builder_name)
60
61 image_hash = IMAGES[image_name]
62
63
64
65
66 args[
'extra_cflags'].
append(
'-DREBUILD_IF_CHANGED_docker_image=%s' % image_hash)
67
68 script = api.build.resource('docker-compile.sh')
69 api.docker.run('Run build script in Docker', image_hash,
70 checkout_root, out_dir, script, args=[util.py_to_gn(args)])
71
static void append(char **dst, size_t *count, const char *src, size_t n)
def compile_fn(api, checkout_root, out_dir)