2016-07-01 18:09:28 +00:00
|
|
|
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
# This header file defines the "sysroot" variable which is the absolute path
|
|
|
|
# of the sysroot. If no sysroot applies, the variable will be an empty string.
|
|
|
|
|
|
|
|
declare_args() {
|
|
|
|
# The absolute path of the sysroot that is applied when compiling using
|
|
|
|
# the target toolchain.
|
|
|
|
target_sysroot = ""
|
2016-11-07 21:09:45 +00:00
|
|
|
|
2018-10-25 15:05:22 +00:00
|
|
|
# Whether the Debian sysroot should be used.
|
|
|
|
dart_use_debian_sysroot = false
|
2016-11-07 21:09:45 +00:00
|
|
|
}
|
|
|
|
|
2018-10-25 15:05:22 +00:00
|
|
|
if (is_linux && dart_use_debian_sysroot) {
|
2016-11-07 21:09:45 +00:00
|
|
|
if (current_cpu == "x86") {
|
2020-03-10 21:56:11 +00:00
|
|
|
target_sysroot =
|
|
|
|
rebase_path("//build/linux/debian_jessie_i386-sysroot", root_build_dir)
|
2016-11-07 21:09:45 +00:00
|
|
|
} else if (current_cpu == "x64") {
|
2020-03-10 21:56:11 +00:00
|
|
|
target_sysroot =
|
|
|
|
rebase_path("//build/linux/debian_jessie_amd64-sysroot", root_build_dir)
|
2017-12-02 06:19:33 +00:00
|
|
|
} else if (current_cpu == "arm") {
|
2020-03-10 21:56:11 +00:00
|
|
|
target_sysroot =
|
|
|
|
rebase_path("//build/linux/debian_jessie_arm-sysroot", root_build_dir)
|
2017-12-02 06:19:33 +00:00
|
|
|
} else if (current_cpu == "arm64") {
|
2020-03-10 21:56:11 +00:00
|
|
|
target_sysroot =
|
|
|
|
rebase_path("//build/linux/debian_jessie_arm64-sysroot", root_build_dir)
|
2016-11-07 21:09:45 +00:00
|
|
|
} else {
|
2018-10-25 15:05:22 +00:00
|
|
|
print("There is no Debian sysroot present for $current_cpu")
|
2016-11-07 21:09:45 +00:00
|
|
|
assert(false)
|
|
|
|
}
|
2016-07-01 18:09:28 +00:00
|
|
|
}
|
|
|
|
|
2020-06-08 16:50:21 +00:00
|
|
|
if ((current_toolchain == host_toolchain ||
|
|
|
|
current_toolchain == default_toolchain) && target_sysroot != "") {
|
2016-07-01 18:09:28 +00:00
|
|
|
sysroot = target_sysroot
|
|
|
|
} else if (is_android) {
|
|
|
|
import("//build/config/android/config.gni")
|
2018-11-29 15:37:40 +00:00
|
|
|
sysroot = rebase_path("$android_ndk_root/sysroot")
|
2016-07-01 18:09:28 +00:00
|
|
|
} else if (is_mac) {
|
|
|
|
import("//build/config/mac/mac_sdk.gni")
|
|
|
|
sysroot = mac_sdk_path
|
|
|
|
} else {
|
|
|
|
sysroot = ""
|
|
|
|
}
|