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 = current_cpu == "arm" || current_cpu == "arm64" 13} 14 15if (current_os == target_os && current_cpu == target_cpu && 16 target_sysroot != "") { 17 sysroot = target_sysroot 18} else if (is_ohos) { 19 import("//build/config/ohos/config.gni") 20 sysroot = "${musl_sysroot}" 21} else if (is_android || (is_linux && use_sysroot)) { 22 import("//build_plugins/config/aosp/sysroot.gni") 23} else if (is_mac) { 24 import("//build/config/mac/mac_sdk.gni") 25 sysroot = mac_sdk_path 26} else if (is_ios) { 27 import("//build_plugins/config/ios/ios_sdk.gni") 28 sysroot = ios_sdk_path 29} else { 30 sysroot = "" 31} 32 33if (!defined(link_sysroot)) { 34 link_sysroot = sysroot 35} 36