OLD | NEW |
| (Empty) |
1 [TOC] | |
2 | |
3 # Checkout | |
4 If you want to build the Android client then you will need to follow | |
5 instructions [here](https://www.chromium.org/developers/how-tos/android-build-in
structions) | |
6 to sync Android related code as well. | |
7 | |
8 # Using GN | |
9 Blimp only supports building using [GN](../../tools/gn/README.md). A quick | |
10 overview over how to use GN can be found in the GN | |
11 [quick start guide](../../tools/gn/docs/quick_start.md). | |
12 | |
13 ## Building | |
14 | |
15 There are two different build configurations depending on what you want to | |
16 build, either the client or the engine. | |
17 | |
18 Regardless of which you build, it is helpful to setup the following | |
19 environment variable in your shell to get a better view of how the build is | |
20 progressing: | |
21 | |
22 ```bash | |
23 export NINJA_STATUS="[%r %f/%s/%u/%t] " | |
24 ``` | |
25 | |
26 It will give you a count for the following values: | |
27 `[RUNNING FINISHED/STARTED/NOT_STARTED/TOTAL]`. See the | |
28 [ninja manual](https://ninja-build.org/manual.html#_environment_variables) | |
29 for a full list of template values. | |
30 | |
31 ### Android client | |
32 | |
33 Create an out-directory and set the GN args: | |
34 | |
35 ```bash | |
36 mkdir -p out-android/Debug | |
37 echo "import(\"//build/args/blimp_client.gn\")" > out-android/Debug/args.gn | |
38 gn gen out-android/Debug | |
39 ``` | |
40 | |
41 To build: | |
42 | |
43 ```bash | |
44 ninja -C out-android/Debug blimp chrome_public_apk | |
45 ``` | |
46 | |
47 You can install with this command: | |
48 | |
49 ```bash | |
50 adb install out-android/Debug/apks/ChromePublic.apk | |
51 ``` | |
52 | |
53 To add your own build preferences: | |
54 | |
55 ```bash | |
56 gn args out-android/Debug | |
57 ``` | |
58 | |
59 For example, you can build `x86` APK by adding `target_cpu = "x86"` to the `gn | |
60 args`. | |
61 | |
62 | |
63 ### Engine | |
64 | |
65 Create another out-directory and set the GN args: | |
66 | |
67 ```bash | |
68 mkdir -p out-linux/Debug | |
69 echo "import(\"//build/args/blimp_engine.gn\")" > out-linux/Debug/args.gn | |
70 gn gen out-linux/Debug | |
71 ``` | |
72 | |
73 To build: | |
74 | |
75 ```bash | |
76 ninja -C out-linux/Debug blimp | |
77 ``` | |
78 | |
79 To add your own build preferences | |
80 | |
81 ```bash | |
82 gn args out-linux/Debug | |
83 ``` | |
84 | |
85 ## Adding new build arguments | |
86 | |
87 Adding new build arguments should be fairly rare. Arguments first need to be | |
88 [declared](../../tools/gn/docs/quick_start.md#Add-a-new-build-argument). | |
89 | |
90 They can then be used to change how the binary is built or passed through to | |
91 code as a | |
92 [defines](../../tools/gn/docs/reference.md#defines_C-preprocessor-defines). | |
93 | |
94 Finally the Blimp argument templates should be updated to reflect the | |
95 (non-default for Chrome) behavior desired by Blimp (see below). | |
96 | |
97 ## Updating bulid arguments in templates | |
98 | |
99 Build argument templates exist for the client and engine at | |
100 [`build/args/blimp_client.gn`](../../build/args/blimp_client.gn) and | |
101 [`build/args/blimp_engine.gn`](../../build/args/blimp_engine.gn). | |
102 | |
103 These can be updated as in the same manner as your personal `args.gn` files | |
104 to override default argument values. | |
OLD | NEW |