gn build: Create a variable for the host toolchain and start using it in the tblgen template.

Differential Revision: https://reviews.llvm.org/D56575

llvm-svn: 350964
This commit is contained in:
Peter Collingbourne 2019-01-11 19:53:06 +00:00
parent 17ee5a2d80
commit fe44363f0d
3 changed files with 5 additions and 4 deletions

View File

@ -26,7 +26,9 @@ set_defaults("source_set") {
}
if (host_os == "win") {
set_default_toolchain("//llvm/utils/gn/build/toolchain:win")
host_toolchain = "//llvm/utils/gn/build/toolchain:win"
} else {
set_default_toolchain("//llvm/utils/gn/build/toolchain:unix")
host_toolchain = "//llvm/utils/gn/build/toolchain:unix"
}
set_default_toolchain(host_toolchain)

View File

@ -35,7 +35,6 @@ template("clang_tablegen") {
"visibility",
])
# FIXME: In cross builds, this should depend on the host binary.
tblgen_target = "//clang/utils/TableGen:clang-tblgen"
}
}

View File

@ -39,9 +39,9 @@ template("tablegen") {
if (defined(invoker.tblgen_target)) {
tblgen_target = invoker.tblgen_target
} else {
# FIXME: In cross builds, this should depend on the host binary.
tblgen_target = "//llvm/utils/TableGen:llvm-tblgen"
}
tblgen_target += "($host_toolchain)"
tblgen_executable = get_label_info(tblgen_target, "root_out_dir") +
"/bin/" + get_label_info(tblgen_target, "name")
deps = [