blob: bd1d9fcc3ca70e804d4d6d48d163e30da6694a87 [file] [log] [blame]
# Copyright 2016 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/toolchain/clang_toolchain.gni")
import("//build/config/fuchsia/config.gni")
clang_toolchain("host_${host_cpu}") {
if (host_cpu == "arm64") {
clang_cpu = "aarch64"
} else if (host_cpu == "x64") {
clang_cpu = "x86_64"
} else {
assert(false, "Host CPU not supported")
}
if (host_os == "linux") {
clang_os = "linux"
} else if (host_os == "mac") {
clang_os = "darwin"
} else {
assert(false, "Host OS not supported")
}
clang_name = "clang+llvm-$clang_cpu-$clang_os"
clang_path = "//buildtools/toolchain/$clang_name"
prefix = rebase_path("$clang_path/bin/", root_build_dir)
cc = "${prefix}clang"
cxx = "${prefix}clang++"
ld = cxx
ar = "${prefix}llvm-ar"
toolchain_cpu = host_cpu
toolchain_os = host_os
}