Files
sdk/build/toolchain/toolchain_suite.gni
Ryan Macnak 6b500b2517 [build] Put sanitizer versions of the AOT runtime into the SDK for testing.
Note there is no need for versions of gen_snapshot because the sanitizer target is a runtime flag.

Change-Id: I25485e27331a0b8724e954a5222a11a1db45cfb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464623
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-12-01 15:06:53 -08:00

75 lines
1.7 KiB
Plaintext

# Converts a single toolchain definition into multple toolchains with
# different toolchain args.
# Even though these imports aren't used directly, they are required so
# that the template works when it is called.
import("//build/toolchain/android/android_toolchain.gni")
import("//build/toolchain/gcc_toolchain.gni")
if (host_os == "mac") {
import("//build/toolchain/mac/mac_toolchain.gni")
}
if (is_win) {
import("//build/toolchain/win/msvc_toolchain.gni")
}
if (is_fuchsia) {
import("//build/toolchain/fuchsia/fuchsia_toolchain.gni")
}
_all_toolchains = [
# default toolchain.
{
suffix = ""
toolchain_args = {
is_shared_library = false
}
},
# toolchain for building shared libraries.
{
suffix = "_shared"
toolchain_args = {
is_shared_library = true
}
},
{
suffix = "_asan"
toolchain_args = {
is_shared_library = false
is_asan = true
}
},
{
suffix = "_msan"
toolchain_args = {
is_shared_library = false
is_msan = true
}
},
{
suffix = "_tsan"
toolchain_args = {
is_shared_library = false
is_tsan = true
}
},
]
template("toolchain_suite") {
assert(defined(invoker.toolchain_template),
"tolchain_suite() must specify a \"toolchain_template\" value")
_target_type = invoker.toolchain_template
foreach(conf, _all_toolchains) {
target(_target_type, "${target_name}${conf.suffix}") {
forward_variables_from(invoker, "*", [ "toolchain_args" ])
toolchain_args = {
forward_variables_from(conf.toolchain_args, "*")
if (defined(invoker.toolchain_args)) {
forward_variables_from(invoker.toolchain_args, "*")
}
}
}
}
}