• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2013 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  # The absolute path of the sysroot that is applied when compiling using
10  # the target toolchain.
11  target_sysroot = ""
12  use_sysroot =
13      current_cpu == "arm" || current_cpu == "arm64" || current_cpu == "riscv64"
14}
15
16if (current_os == target_os && current_cpu == target_cpu &&
17    target_sysroot != "") {
18  sysroot = target_sysroot
19} else if (is_ohos) {
20  import("//build/config/ohos/config.gni")
21  sysroot = "${musl_sysroot}"
22} else if (is_android || (is_linux && use_sysroot)) {
23  import("//build_plugins/config/aosp/sysroot.gni")
24} else if (is_mac) {
25  import("//build/config/mac/mac_sdk.gni")
26  sysroot = mac_sdk_path
27} else if (is_ios) {
28  import("//build_plugins/config/ios/ios_sdk.gni")
29  sysroot = ios_sdk_path
30} else {
31  sysroot = ""
32}
33
34if (!defined(link_sysroot)) {
35  link_sysroot = sysroot
36}
37