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_mac) { 22 import("//build/config/mac/mac_sdk.gni") 23 sysroot = mac_sdk_path 24} else { 25 sysroot = "" 26} 27 28link_sysroot = sysroot 29