clang_toolchain.BUILD 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. "x64_windows": ":cc-compiler-x64-windows",
  22. },
  23. )
  24. cc_toolchain(
  25. name = "cc-compiler-k8",
  26. all_files = ":empty",
  27. ar_files = ":empty",
  28. as_files = ":empty",
  29. compiler_files = ":empty",
  30. dwp_files = ":empty",
  31. linker_files = ":empty",
  32. objcopy_files = ":empty",
  33. strip_files = ":empty",
  34. supports_param_files = 1,
  35. toolchain_config = ":local-k8",
  36. toolchain_identifier = "local-k8",
  37. )
  38. cc_toolchain_config(
  39. name = "local-k8",
  40. target_cpu = "k8",
  41. )
  42. cc_toolchain(
  43. name = "cc-compiler-darwin",
  44. all_files = ":empty",
  45. ar_files = ":empty",
  46. as_files = ":empty",
  47. compiler_files = ":empty",
  48. dwp_files = ":empty",
  49. linker_files = ":empty",
  50. objcopy_files = ":empty",
  51. strip_files = ":empty",
  52. supports_param_files = 1,
  53. toolchain_config = ":local-darwin",
  54. toolchain_identifier = "local-darwin",
  55. )
  56. cc_toolchain_config(
  57. name = "local-darwin",
  58. target_cpu = "darwin",
  59. )
  60. cc_toolchain(
  61. name = "cc-compiler-darwin-arm64",
  62. all_files = ":empty",
  63. ar_files = ":empty",
  64. as_files = ":empty",
  65. compiler_files = ":empty",
  66. dwp_files = ":empty",
  67. linker_files = ":empty",
  68. objcopy_files = ":empty",
  69. strip_files = ":empty",
  70. supports_param_files = 1,
  71. toolchain_config = ":local-darwin-arm64",
  72. toolchain_identifier = "local-darwin-arm64",
  73. )
  74. cc_toolchain_config(
  75. name = "local-darwin-arm64",
  76. target_cpu = "darwin_arm64",
  77. )
  78. cc_toolchain(
  79. name = "cc-compiler-x64-windows",
  80. all_files = ":empty",
  81. ar_files = ":empty",
  82. as_files = ":empty",
  83. compiler_files = ":empty",
  84. dwp_files = ":empty",
  85. linker_files = ":empty",
  86. objcopy_files = ":empty",
  87. strip_files = ":empty",
  88. supports_param_files = 1,
  89. toolchain_config = ":local-x64-windows",
  90. toolchain_identifier = "local-x64-windows",
  91. )
  92. cc_toolchain_config(
  93. name = "local-x64-windows",
  94. target_cpu = "x64_windows",
  95. )