clang_toolchain.BUILD 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. # This file is symlinked into a configured Clang toolchain repository as the
  5. # root `BUILD` file for that repository.
  6. load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite")
  7. load(":cc_toolchain_config.bzl", "cc_toolchain_config")
  8. cc_library(
  9. name = "malloc",
  10. )
  11. filegroup(
  12. name = "empty",
  13. srcs = [],
  14. )
  15. cc_toolchain_suite(
  16. name = "bazel_cc_toolchain",
  17. toolchains = {
  18. "darwin": ":cc-compiler-darwin",
  19. "darwin_arm64": ":cc-compiler-darwin-arm64",
  20. "k8": ":cc-compiler-k8",
  21. },
  22. )
  23. cc_toolchain(
  24. name = "cc-compiler-k8",
  25. all_files = ":empty",
  26. ar_files = ":empty",
  27. as_files = ":empty",
  28. compiler_files = ":empty",
  29. dwp_files = ":empty",
  30. linker_files = ":empty",
  31. objcopy_files = ":empty",
  32. strip_files = ":empty",
  33. supports_param_files = 1,
  34. toolchain_config = ":local-k8",
  35. toolchain_identifier = "local-k8",
  36. )
  37. cc_toolchain_config(
  38. name = "local-k8",
  39. target_cpu = "k8",
  40. )
  41. cc_toolchain(
  42. name = "cc-compiler-darwin",
  43. all_files = ":empty",
  44. ar_files = ":empty",
  45. as_files = ":empty",
  46. compiler_files = ":empty",
  47. dwp_files = ":empty",
  48. linker_files = ":empty",
  49. objcopy_files = ":empty",
  50. strip_files = ":empty",
  51. supports_param_files = 1,
  52. toolchain_config = ":local-darwin",
  53. toolchain_identifier = "local-darwin",
  54. )
  55. cc_toolchain_config(
  56. name = "local-darwin",
  57. target_cpu = "darwin",
  58. )
  59. cc_toolchain(
  60. name = "cc-compiler-darwin-arm64",
  61. all_files = ":empty",
  62. ar_files = ":empty",
  63. as_files = ":empty",
  64. compiler_files = ":empty",
  65. dwp_files = ":empty",
  66. linker_files = ":empty",
  67. objcopy_files = ":empty",
  68. strip_files = ":empty",
  69. supports_param_files = 1,
  70. toolchain_config = ":local-darwin-arm64",
  71. toolchain_identifier = "local-darwin-arm64",
  72. )
  73. cc_toolchain_config(
  74. name = "local-darwin-arm64",
  75. target_cpu = "darwin_arm64",
  76. )