summaryrefslogtreecommitdiff
path: root/chromium/blimp/docs/build.md
blob: 638cefa76f78b2e30f1f7ded48905db4311de2d5 (plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Using GN
Blimp only supports building using [GN](../../tools/gn/README.md). A quick
overview over how to use GN can be found in the GN
[quick start guide](../../tools/gn/docs/quick_start.md).

## Building

There are two different build configurations depending on what you want to
build:

### Android client

Create an out-directory and set the GN args:

```bash
mkdir -p out-android/Debug
echo "import(\"//build/args/blimp_client.gn\")" > out-android/Debug/args.gn
gn gen out-android/Debug
```

To build:

```bash
ninja -C out-android/Debug blimp
```

This will also generate an incremental APK, which you can install with this
command:

```bash
out-android/Debug/bin/install_blimp_apk_incremental
```

During development, it might be beneficial to put these two commands together
like this:

```bash
ninja -C out-android/Debug blimp && \
    out-android/Debug/bin/install_blimp_apk_incremental
```

To add your own build preferences:

```bash
gn args out-android/Debug
```

### Engine

Create another out-directory and set the GN args:

```bash
mkdir -p out-linux/Debug
echo "import(\"//build/args/blimp_engine.gn\")" > out-linux/Debug/args.gn
gn gen out-linux/Debug
```

To build:

```bash
ninja -C out-linux/Debug blimp
```

To add your own build preferences

```bash
gn args out-linux/Debug
```

## Adding new build arguments

Adding new build arguments should be fairly rare. Arguments first need to be
[declared](../../tools/gn/docs/quick_start.md#Add-a-new-build-argument).

They can then be used to change how the binary is built or passed through to
code as a
[defines](../../tools/gn/docs/reference.md#defines_C-preprocessor-defines).

Finally the Blimp argument templates should be updated to reflect the
(non-default for Chrome) behavior desired by Blimp (see below).

## Updating bulid arguments in templates

Build argument templates exist for the client and engine at
[`build/args/blimp_client.gn`](../../build/args/blimp_client.gn) and
[`build/args/blimp_engine.gn`](../../build/args/blimp_engine.gn).

These can be updated as in the same manner as your personal `args.gn` files
to override default argument values.