blob: ed684b35ff7dcd7da0c34eeea3da6b508febd5a5 [file] [log] [blame]
Patrick Rohr6d722af2023-01-05 07:16:46 -08001#!/bin/bash
2set -x
3
4# Run this script inside a full chromium checkout.
5# TODO: add support for applying local patches.
6
7OUT_PATH="out/cronet"
8
9#######################################
10# Generate desc.json for a specified architecture.
11# Globals:
12# OUT_PATH
13# Arguments:
14# target_cpu, string
15#######################################
16function gn_desc() {
17 local -a gn_args=(
18 "target_os = \"android\""
19 "enable_websockets = false"
20 "disable_file_support = true"
21 "disable_brotli_filter = false"
22 "is_component_build = false"
23 "use_crash_key_stubs = true"
24 "use_partition_alloc = false"
25 "include_transport_security_state_preload_list = false"
26 "use_platform_icu_alternatives = true"
27 "default_min_sdk_version = 19"
28 "use_errorprone_java_compiler = true"
29 "enable_reporting = true"
30 "use_hashed_jni_names = true"
31 "treat_warnings_as_errors = false"
32 "enable_base_tracing = false"
Motomu Utsumiedf300c2023-01-12 17:52:21 +090033 "is_cronet_build = true"
Patrick Rohr6d722af2023-01-05 07:16:46 -080034 )
35 gn_args+=("target_cpu = \"${1}\"")
36
37 # Only set arm_use_neon on arm architectures to prevent warning from being
38 # written to json output.
39 if [[ "$1" =~ ^arm ]]; then
40 gn_args+=("arm_use_neon = false")
41 fi
42
43 # Configure gn args.
44 gn gen "${OUT_PATH}" --args="${gn_args[*]}"
45
46 # Generate desc.json.
47 local -r out_file="desc_${1}.json"
48 gn desc "${OUT_PATH}" --format=json --all-toolchains "//*" > "${out_file}"
49}
50
51gn_desc x86
52gn_desc x64
53gn_desc arm
54gn_desc arm64
55