xref: /aosp_15_r20/external/angle/doc/BuildingAngleForChromiumDevelopment.md (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker# How to build ANGLE in Chromium for dev
2*8975f5c5SAndroid Build Coastguard Worker
3*8975f5c5SAndroid Build Coastguard Worker## Introduction
4*8975f5c5SAndroid Build Coastguard Worker
5*8975f5c5SAndroid Build Coastguard WorkerOn Windows, Linux, and Mac ANGLE now builds most core components cross platform, including the shader validator and translator as well as the graphics API translator. These parts can be built and tested inside a Chromium checkout.
6*8975f5c5SAndroid Build Coastguard Worker
7*8975f5c5SAndroid Build Coastguard WorkerANGLE also includes some sample applications and a few other targets that don't build on Chromium. These steps describe how to build such targets within a Chromium checkout.
8*8975f5c5SAndroid Build Coastguard Worker
9*8975f5c5SAndroid Build Coastguard WorkerPrerequisite Steps:
10*8975f5c5SAndroid Build Coastguard Worker
11*8975f5c5SAndroid Build Coastguard Worker  * Checkout and build [Chromium](http://dev.chromium.org/Home).
12*8975f5c5SAndroid Build Coastguard Worker  * To setup run these commands (note similarity to [DevSetup](DevSetup.md)):
13*8975f5c5SAndroid Build Coastguard Worker
14*8975f5c5SAndroid Build Coastguard Worker## Standalone ANGLE inside Chromium
15*8975f5c5SAndroid Build Coastguard Worker
16*8975f5c5SAndroid Build Coastguard Worker  * To sync all standalone dependencies run:
17*8975f5c5SAndroid Build Coastguard Worker
18*8975f5c5SAndroid Build Coastguard Worker```bash
19*8975f5c5SAndroid Build Coastguard Workercd src/third_party/angle
20*8975f5c5SAndroid Build Coastguard Workerpython3 scripts/bootstrap.py
21*8975f5c5SAndroid Build Coastguard Workergclient sync
22*8975f5c5SAndroid Build Coastguard Worker```
23*8975f5c5SAndroid Build Coastguard Worker
24*8975f5c5SAndroid Build Coastguard Worker  * To generate ANGLE standalone build files run:
25*8975f5c5SAndroid Build Coastguard Worker
26*8975f5c5SAndroid Build Coastguard Worker```bash
27*8975f5c5SAndroid Build Coastguard Workercd src/third_party/angle
28*8975f5c5SAndroid Build Coastguard Workergn gen out/Debug
29*8975f5c5SAndroid Build Coastguard Worker```
30*8975f5c5SAndroid Build Coastguard Worker
31*8975f5c5SAndroid Build Coastguard Worker  * To build:
32*8975f5c5SAndroid Build Coastguard Worker
33*8975f5c5SAndroid Build Coastguard Worker```bash
34*8975f5c5SAndroid Build Coastguard Workercd src/third_party/angle
35*8975f5c5SAndroid Build Coastguard Workerninja -j 10 -k1 -C out/Debug
36*8975f5c5SAndroid Build Coastguard Worker```
37*8975f5c5SAndroid Build Coastguard Worker
38*8975f5c5SAndroid Build Coastguard Worker  * For example, `ninja -j 10 -k1 -C out/Debug angle_gles2_deqp_tests`
39*8975f5c5SAndroid Build Coastguard Worker  * To run a sample application: `./out/Debug/hello_triangle`
40*8975f5c5SAndroid Build Coastguard Worker  * To go back to the Chromium-managed version, remove `third_party/angle/.gclient`.
41*8975f5c5SAndroid Build Coastguard Worker
42*8975f5c5SAndroid Build Coastguard Worker## Working with ANGLE in Chromium
43*8975f5c5SAndroid Build Coastguard Worker
44*8975f5c5SAndroid Build Coastguard WorkerYou will also want to work with a local version of ANGLE instead of the version that is pulled in by Chromium's [DEPS](https://chromium.googlesource.com/chromium/src/+/main/DEPS) file. To do this do the following:
45*8975f5c5SAndroid Build Coastguard Worker
46*8975f5c5SAndroid Build Coastguard Worker  * cd to `chromium/`. One directory above `chromium/src`. Add this to `chromium/.gclient`:
47*8975f5c5SAndroid Build Coastguard Worker
48*8975f5c5SAndroid Build Coastguard Worker```python
49*8975f5c5SAndroid Build Coastguard Workersolutions = [
50*8975f5c5SAndroid Build Coastguard Worker  {
51*8975f5c5SAndroid Build Coastguard Worker    # ...
52*8975f5c5SAndroid Build Coastguard Worker    u'custom_deps':
53*8975f5c5SAndroid Build Coastguard Worker    {
54*8975f5c5SAndroid Build Coastguard Worker      "src/third_party/angle": None,
55*8975f5c5SAndroid Build Coastguard Worker    },
56*8975f5c5SAndroid Build Coastguard Worker  },
57*8975f5c5SAndroid Build Coastguard Worker]
58*8975f5c5SAndroid Build Coastguard Worker```
59*8975f5c5SAndroid Build Coastguard Worker
60*8975f5c5SAndroid Build Coastguard WorkerYou will have full control over your ANGLE workspace and are responsible for running all git commands (pull, rebase, etc.) for managing your branches.
61*8975f5c5SAndroid Build Coastguard Worker
62*8975f5c5SAndroid Build Coastguard WorkerIf you decide you need to go back to the DEPS version of ANGLE:
63*8975f5c5SAndroid Build Coastguard Worker
64*8975f5c5SAndroid Build Coastguard Worker  * Comment out or remove the `src/third_party/angle` line in your `custom_deps` in `chomium/.gclient`.
65*8975f5c5SAndroid Build Coastguard Worker  * Se the ANGLE workspace to the version specified in Chromium's DEPS. Ensure there are no modified or new files.
66*8975f5c5SAndroid Build Coastguard Worker  * `gclient sync` your Chromium workspace.
67