dart-sdk/build/config/sysroot.gni
なつき afe9219026 [infra] Support for Alpine Linux Sysroot
Closes https://github.com/dart-lang/sdk/pull/51044

TEST=manually tested by the contributor

GitOrigin-RevId: 86c85da0680047e08caf81cc4c12098ae85c0d2b
Change-Id: I591d7e17ce3a87cf8ce8380c9511f70d738d44c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279267
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-19 10:36:51 +00:00

71 lines
2.5 KiB
Plaintext

# 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 = ""
# The type of sysroot to be used. Empty string means no sysroot.
# Supported sysroots: ["alpine","debian"]
dart_sysroot = ""
}
if (is_linux) {
if (dart_sysroot == "alpine") {
if (current_cpu == "x86") {
target_sysroot =
rebase_path("//build/linux/alpine-linux-x86-sysroot", root_build_dir)
} else if (current_cpu == "x64") {
target_sysroot =
rebase_path("//build/linux/alpine-linux-x86_64-sysroot", root_build_dir)
} else if (current_cpu == "arm") {
target_sysroot =
rebase_path("//build/linux/alpine-linux-armv7-sysroot", root_build_dir)
} else if (current_cpu == "arm64") {
target_sysroot =
rebase_path("//build/linux/alpine-linux-aarch64-sysroot", root_build_dir)
} else {
print("There is no $dart_sysroot sysroot present for $current_cpu")
assert(false)
}
} else if (dart_sysroot == "debian") {
if (current_cpu == "x86") {
target_sysroot =
rebase_path("//build/linux/debian_stretch_i386-sysroot", root_build_dir)
} else if (current_cpu == "x64") {
target_sysroot =
rebase_path("//build/linux/debian_stretch_amd64-sysroot", root_build_dir)
} else if (current_cpu == "arm") {
target_sysroot =
rebase_path("//build/linux/debian_stretch_arm-sysroot", root_build_dir)
} else if (current_cpu == "arm64") {
target_sysroot =
rebase_path("//build/linux/debian_stretch_arm64-sysroot", root_build_dir)
} else {
print("There is no $dart_sysroot sysroot present for $current_cpu")
assert(false)
}
} else if (dart_sysroot != "") {
print("There is no $dart_sysroot sysroot support")
assert(false)
}
}
if ((current_toolchain == host_toolchain ||
current_toolchain == default_toolchain) && target_sysroot != "") {
sysroot = target_sysroot
} else if (is_android) {
import("//build/config/android/config.gni")
sysroot = rebase_path("$android_ndk_root/sysroot")
} else if (is_mac) {
import("//build/config/mac/mac_sdk.gni")
sysroot = mac_sdk_path
} else {
sysroot = ""
}