xref: /aosp_15_r20/external/cronet/build/args/chromeos/README.md (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1*6777b538SAndroid Build Coastguard WorkerThis directory is used to store GN arg mapping for Chrome OS boards. The values
2*6777b538SAndroid Build Coastguard Workerof the args are determined by processing the [chromeos-chrome ebuild] for a
3*6777b538SAndroid Build Coastguard Workergiven board and a given ChromeOS version (stored in the [CHROMEOS_LKGM] file).
4*6777b538SAndroid Build Coastguard Worker
5*6777b538SAndroid Build Coastguard WorkerFiles in this directory are populated by running `gclient sync` with specific
6*6777b538SAndroid Build Coastguard Workerarguments set in the .gclient file. Specifically:
7*6777b538SAndroid Build Coastguard Worker* The file must have a top-level variable set: `target_os = ["chromeos"]`
8*6777b538SAndroid Build Coastguard Worker* The `"custom_vars"` parameter of the chromium/src.git solution must include
9*6777b538SAndroid Build Coastguard Worker  the parameter: `"cros_boards": "{BOARD_NAMES}"` where `{BOARD_NAMES}` is a
10*6777b538SAndroid Build Coastguard Worker  colon-separated list of boards you'd like to checkout.
11*6777b538SAndroid Build Coastguard Worker* If you'd like to a checkout a QEMU-bootable image for a given board, include
12*6777b538SAndroid Build Coastguard Worker  it in the `cros_boards_with_qemu_images` var rather than the `cros_boards`
13*6777b538SAndroid Build Coastguard Worker  var.
14*6777b538SAndroid Build Coastguard Worker
15*6777b538SAndroid Build Coastguard WorkerA typical .gclient file is a sibling of the src/ directory, and might look like
16*6777b538SAndroid Build Coastguard Workerthis:
17*6777b538SAndroid Build Coastguard Worker```
18*6777b538SAndroid Build Coastguard Workersolutions = [
19*6777b538SAndroid Build Coastguard Worker  {
20*6777b538SAndroid Build Coastguard Worker    "url": "https://chromium.googlesource.com/chromium/src.git",
21*6777b538SAndroid Build Coastguard Worker    "managed": False,
22*6777b538SAndroid Build Coastguard Worker    "name": "src",
23*6777b538SAndroid Build Coastguard Worker    "custom_deps": {},
24*6777b538SAndroid Build Coastguard Worker    "custom_vars" : {
25*6777b538SAndroid Build Coastguard Worker        "checkout_src_internal": True,
26*6777b538SAndroid Build Coastguard Worker        "cros_boards": "eve:kevin",
27*6777b538SAndroid Build Coastguard Worker        # If a QEMU-bootable image is desired for any board, move it from
28*6777b538SAndroid Build Coastguard Worker        # the previous var to the following:
29*6777b538SAndroid Build Coastguard Worker        "cros_boards_with_qemu_images": "amd64-generic",
30*6777b538SAndroid Build Coastguard Worker    },
31*6777b538SAndroid Build Coastguard Worker  },
32*6777b538SAndroid Build Coastguard Worker]
33*6777b538SAndroid Build Coastguard Workertarget_os = ["chromeos"]
34*6777b538SAndroid Build Coastguard Worker```
35*6777b538SAndroid Build Coastguard Worker
36*6777b538SAndroid Build Coastguard WorkerTo use these files in a build, simply add the following line to your GN args:
37*6777b538SAndroid Build Coastguard Worker```
38*6777b538SAndroid Build Coastguard Workerimport("//build/args/chromeos/${some_board}.gni")
39*6777b538SAndroid Build Coastguard Worker```
40*6777b538SAndroid Build Coastguard Worker
41*6777b538SAndroid Build Coastguard WorkerThat will produce a Chrome OS build of Chrome very similar to what is shipped
42*6777b538SAndroid Build Coastguard Workerfor that device. You can also supply additional args or even overwrite ones
43*6777b538SAndroid Build Coastguard Workersupplied in the .gni file after the `import()` line. For example, the following
44*6777b538SAndroid Build Coastguard Workerargs will produce a debug build of Chrome for board=eve using goma:
45*6777b538SAndroid Build Coastguard Worker```
46*6777b538SAndroid Build Coastguard Workerimport("//build/args/chromeos/eve.gni")
47*6777b538SAndroid Build Coastguard Worker
48*6777b538SAndroid Build Coastguard Workeris_debug = true
49*6777b538SAndroid Build Coastguard Workeruse_remoteexec = true
50*6777b538SAndroid Build Coastguard Worker```
51*6777b538SAndroid Build Coastguard Worker
52*6777b538SAndroid Build Coastguard WorkerTODO(bpastene): Make 'cros_boards' a first class citizen in gclient and replace
53*6777b538SAndroid Build Coastguard Workerit with 'target_boards' instead.
54*6777b538SAndroid Build Coastguard Worker
55*6777b538SAndroid Build Coastguard Worker[chromeos-chrome ebuild]: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/HEAD/chromeos-base/chromeos-chrome/chromeos-chrome-9999.ebuild
56*6777b538SAndroid Build Coastguard Worker[CHROMEOS_LKGM]: https://chromium.googlesource.com/chromium/src/+/HEAD/chromeos/CHROMEOS_LKGM
57