blob: 510b967355c0c3631b0627bdef0dcc3a2f1d1234 [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"
33 )
34 gn_args+=("target_cpu = \"${1}\"")
35
36 # Only set arm_use_neon on arm architectures to prevent warning from being
37 # written to json output.
38 if [[ "$1" =~ ^arm ]]; then
39 gn_args+=("arm_use_neon = false")
40 fi
41
42 # Configure gn args.
43 gn gen "${OUT_PATH}" --args="${gn_args[*]}"
44
45 # Generate desc.json.
46 local -r out_file="desc_${1}.json"
47 gn desc "${OUT_PATH}" --format=json --all-toolchains "//*" > "${out_file}"
48}
49
50gn_desc x86
51gn_desc x64
52gn_desc arm
53gn_desc arm64
54