1# Copyright 2019 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5# This header file defines the "sysroot" variable which is the absolute path 6# of the sysroot. If no sysroot applies, the variable will be an empty string. 7 8declare_args() { 9 sysroot = "" 10 11 # The relative path to directory containing sysroot images 12 target_sysroot_dir = "../" 13 14 use_sysroot = current_cpu == "arm" || current_cpu == "arm64" 15 16 sysroot_platform = "sid" 17} 18 19if (use_sysroot) { 20 assert(sysroot_platform == "sid" || sysroot_platform == "stretch") 21 assert(current_cpu == "arm" || current_cpu == "arm64") 22 23 # By default build against a sysroot image downloaded from Cloud Storage 24 # during gclient runhooks. 25 sysroot = 26 "${target_sysroot_dir}/debian_${sysroot_platform}_${current_cpu}-sysroot" 27 _script_arch = current_cpu 28 29 if (exec_script("//build/scripts/dir_exists.py", 30 [ rebase_path(sysroot) ], 31 "string") != "True") { 32 print("Missing or outdated sysroot for $current_cpu, downloading latest...") 33 exec_script("//build/scripts/install-sysroot.py", 34 [ 35 "$current_cpu", 36 "$sysroot_platform", 37 ]) 38 } 39} 40