| # Copyright 2024 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. |
| |
| default_clang_prefix = "//prebuilt/third_party/clang/${host_os}-${host_cpu}/bin" |
| |
| declare_args() { |
| # The default clang toolchain provided by the prebuilt. This variable is |
| # additionally consumed by the Go toolchain. |
| # LINT.IfChange |
| clang_prefix = default_clang_prefix |
| # LINT.ThenChange(//build/bazel/BUILD.gn) |
| } |
| |
| _clang_prefix_test = string_replace("##${clang_prefix}", "##/tmp/", "") |
| assert( |
| _clang_prefix_test == "##${clang_prefix}", |
| "clang_prefix can't be in /tmp, which is overwritten in Bazel sandboxes, got ${clang_prefix}") |
| |
| # The value of clang_prefix relative to root_build_dir, useful |
| # when expanding it in command arguments. |
| rebased_clang_prefix = rebase_path(clang_prefix, root_build_dir) |
| |
| # While rebased_clang_prefix points to the $CLANG_DIR/bin directory, all |
| # paths in clang_toolchain_info are relative to CLANG_DIR, so compute it here. |
| rebased_clang_dir = get_path_info(rebased_clang_prefix, "dir") |