BUILD 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. load("@bazel_skylib//lib:selects.bzl", "selects")
  5. package(default_visibility = ["//visibility:public"])
  6. constraint_setting(
  7. name = "bootstrap_stage",
  8. default_constraint_value = ":stage0",
  9. )
  10. constraint_value(
  11. name = "stage0",
  12. constraint_setting = ":bootstrap_stage",
  13. )
  14. constraint_value(
  15. name = "stage1",
  16. constraint_setting = ":bootstrap_stage",
  17. )
  18. constraint_value(
  19. name = "stage2",
  20. constraint_setting = ":bootstrap_stage",
  21. )
  22. # For use by defs.bzl.
  23. # Matches when asan is enabled on a macOS platform.
  24. selects.config_setting_group(
  25. name = "macos_asan",
  26. match_all = [
  27. ":is_macos",
  28. ":macos_asan_build_modes",
  29. ],
  30. )
  31. # For use by defs.bzl.
  32. # Matches macOS platforms.
  33. config_setting(
  34. name = "is_macos",
  35. constraint_values = ["@platforms//os:macos"],
  36. )
  37. # For use by defs.bzl.
  38. # Matches build modes where asan is enabled.
  39. selects.config_setting_group(
  40. name = "macos_asan_build_modes",
  41. match_any = [
  42. ":dbg",
  43. ":fastbuild",
  44. ],
  45. )
  46. # For use by defs.bzl.
  47. # Matches dbg.
  48. config_setting(
  49. name = "dbg",
  50. values = {"compilation_mode": "dbg"},
  51. )
  52. # For use by defs.bzl.
  53. # Matches fastbuild.
  54. config_setting(
  55. name = "fastbuild",
  56. values = {"compilation_mode": "fastbuild"},
  57. )
  58. filegroup(
  59. name = "installed_cc_toolchain_starlark",
  60. srcs = [
  61. "carbon_cc_toolchain_config.bzl",
  62. "cc_toolchain_actions.bzl",
  63. "cc_toolchain_base_features.bzl",
  64. "cc_toolchain_config_features.bzl",
  65. "cc_toolchain_cpp_features.bzl",
  66. "cc_toolchain_debugging.bzl",
  67. "cc_toolchain_features.bzl",
  68. "cc_toolchain_linking.bzl",
  69. "cc_toolchain_modules.bzl",
  70. "cc_toolchain_optimization.bzl",
  71. "cc_toolchain_sanitizer_features.bzl",
  72. "cc_toolchain_tools.bzl",
  73. # TODO: Remove this once we can remove the use of it from Carbon
  74. # toolchain rules.
  75. "cc_toolchain_carbon_project_features.bzl",
  76. ],
  77. )