OLD | NEW |
1 # Using GN | 1 # Using GN |
2 Blimp only supports building using [GN](../../tools/gn/README.md). A quick | 2 Blimp only supports building using [GN](../../tools/gn/README.md). A quick |
3 overview over how to use GN can be found in the GN | 3 overview over how to use GN can be found in the GN |
4 [quick start guide](../../tools/gn/docs/quick_start.md). | 4 [quick start guide](../../tools/gn/docs/quick_start.md). |
5 | 5 |
6 There are three different build configurations depending on what you want to | 6 ## Building |
| 7 |
| 8 There are two different build configurations depending on what you want to |
7 build: | 9 build: |
8 | 10 |
9 ## Android client | 11 ### Android client |
10 | 12 |
11 Create an out-directory and set the GN args: | 13 Create an out-directory and set the GN args: |
12 | 14 |
13 ```bash | 15 ```bash |
14 mkdir -p out-android/Debug | 16 mkdir -p out-android/Debug |
15 echo "import(\"//build/args/blimp_client.gn\")" > out-android/Debug/args.gn | 17 echo "import(\"//build/args/blimp_client.gn\")" > out-android/Debug/args.gn |
16 gn gen out-android/Debug | 18 gn gen out-android/Debug |
17 ``` | 19 ``` |
18 | 20 |
19 To build: | 21 To build: |
20 | 22 |
21 ```bash | 23 ```bash |
22 ninja -C out-android/Debug blimp | 24 ninja -C out-android/Debug blimp |
23 ``` | 25 ``` |
24 | 26 |
25 You can also build and install incremental APK like this: | 27 You can also build and install incremental APK like this: |
26 | 28 |
27 ```bash | 29 ```bash |
28 ninja -C out-android/Debug blimp blimp_apk_incremental && | 30 ninja -C out-android/Debug blimp blimp_apk_incremental && |
29 out-android/Debug/bin/install_blimp_apk_incremental | 31 out-android/Debug/bin/install_blimp_apk_incremental |
30 ``` | 32 ``` |
31 | 33 |
32 To add your own build preferences | 34 To add your own build preferences |
33 | 35 |
34 ```bash | 36 ```bash |
35 gn args out-android/Debug | 37 gn args out-android/Debug |
36 ``` | 38 ``` |
37 | 39 |
38 ## Engine | 40 ### Engine |
39 | 41 |
40 Create another out-directory and set the GN args: | 42 Create another out-directory and set the GN args: |
41 | 43 |
42 ```bash | 44 ```bash |
43 mkdir -p out-linux/Debug | 45 mkdir -p out-linux/Debug |
44 echo "import(\"//build/args/blimp_engine.gn\")" > out-linux/Debug/args.gn | 46 echo "import(\"//build/args/blimp_engine.gn\")" > out-linux/Debug/args.gn |
45 gn gen out-linux/Debug | 47 gn gen out-linux/Debug |
46 ``` | 48 ``` |
47 | 49 |
48 To build: | 50 To build: |
49 | 51 |
50 ```bash | 52 ```bash |
51 ninja -C out-linux/Debug blimp | 53 ninja -C out-linux/Debug blimp |
52 ``` | 54 ``` |
53 | 55 |
54 To add your own build preferences | 56 To add your own build preferences |
55 | 57 |
56 ```bash | 58 ```bash |
57 gn args out-android/Debug | 59 gn args out-android/Debug |
58 ``` | 60 ``` |
| 61 |
| 62 ## Adding new build arguments |
| 63 |
| 64 Adding new build arguments should be fairly rare. Arguments first need to be |
| 65 [declared](../../tools/gn/docs/quick_start.md#Add-a-new-build-argument). |
| 66 |
| 67 They can then be used to change how the binary is built or passed through to |
| 68 code as a |
| 69 [defines](../../tools/gn/docs/reference.md#defines_C-preprocessor-defines). |
| 70 |
| 71 Finally the Blimp argument templates should be updated to reflect the |
| 72 (non-default for Chrome) behavior desired by Blimp (see below). |
| 73 |
| 74 ## Updating bulid arguments in templates |
| 75 |
| 76 Build argument templates exist for the client and engine at |
| 77 [`build/args/blimp_client.gn`](../../build/args/blimp_client.gn) and |
| 78 [`build/args/blimp_engine.gn`](../../build/args/blimp_engine.gn). |
| 79 |
| 80 These can be updated as in the same manner as your personal `args.gn` files |
| 81 to override default argument values. |
OLD | NEW |