File: build_instructions.md

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (60 lines) | stat: -rw-r--r-- 1,759 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Cronet build instructions

[TOC]

## Checking out the code

Follow all the
[Get the Code](https://www.chromium.org/developers/how-tos/get-the-code)
instructions for your target platform up to and including running hooks.

## Building Cronet for development and debugging

Similarly to Chromium, to build Cronet for development and debugging purposes:

1. Use `gn` to create ninja files targeting the intended platform
1. Use `ninja` to execute the ninja files to run the build

The two main difference from a Chromium build are:

1. Cronet only builds a subset of Chromium
1. Cronet uses a different set of gn args to build

### Using gn

TODO(crbug.com/40287068): This might change in the future.
Remembering the set of gn args to be used for a Cronet build is complicated.
So, we rely on `//components/cronet/tools/cr_cronet.py` to do that for us.

```shell
$ ./components/cronet/tools/cr_cronet.py gn
```

To better understand how this works, and the configuration paraters it supports,
refer to `cr_cronet.py`'s source code and:

```shell
$ ./components/cronet/tools/cr_cronet.py --help
```

### Using ninja

The previous steps generated the files needed to compile Cronet. All that
remains now is to find a target to build. This can be done through this command:

```shell
$ autoninja -C out/your_cronet_output_directory your_cronet_target
```

Where, `your_cronet_output_directory` is what was set through `cr_cronet` and
`your_cronet_target` is one of of Cronet's target within some `BUILD.gn` file.

## Building Cronet mobile for releases

To build Cronet with optimizations and with debug information stripped out:

```shell
$ gn clean out/Release
$ ./components/cronet/tools/cr_cronet.py gn --release
$ autoninja -C out/Release cronet_package
```