WORKSPACE 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. workspace(name = "carbon")
  5. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
  6. # We want to use LLVM via an external CMake build, so pull in the Bazel
  7. # infrastructure that provides direct CMake interfacing support.
  8. http_archive(
  9. name = "rules_foreign_cc",
  10. strip_prefix = "rules_foreign_cc-main",
  11. url = "https://github.com/bazelbuild/rules_foreign_cc/archive/main.zip",
  12. )
  13. # Add Bazel's python rules.
  14. http_archive(
  15. name = "rules_python",
  16. sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
  17. url = "https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz",
  18. )
  19. # Set up necessary dependencies for working with the foreign C++ rules.
  20. load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
  21. rules_foreign_cc_dependencies()
  22. # Bootstrap a Clang and LLVM toolchain.
  23. load("//bazel/cc_toolchains:clang_bootstrap.bzl", "bootstrap_clang_toolchain")
  24. bootstrap_clang_toolchain(name = "bootstrap_clang_toolchain")
  25. # Configure the bootstrapped Clang and LLVM toolchain for Bazel.
  26. load("//bazel/cc_toolchains:clang_configuration.bzl", "configure_clang_toolchain")
  27. configure_clang_toolchain(
  28. name = "bazel_cc_toolchain",
  29. clang = "@bootstrap_clang_toolchain//:bin/clang",
  30. )
  31. local_repository(
  32. name = "llvm_bazel",
  33. path = "third_party/llvm-bazel/llvm-bazel",
  34. )
  35. load("@llvm_bazel//:configure.bzl", "llvm_configure")
  36. llvm_configure(
  37. name = "llvm-project",
  38. src_path = "third_party/llvm-project",
  39. src_workspace = "@carbon//:WORKSPACE",
  40. )
  41. load("@llvm_bazel//:terminfo.bzl", "llvm_terminfo_system")
  42. # We require successful detection and use of a system terminfo library.
  43. llvm_terminfo_system(name = "llvm_terminfo")
  44. load("@llvm_bazel//:zlib.bzl", "llvm_zlib_system")
  45. # We require successful detection and use of a system zlib library.
  46. llvm_zlib_system(name = "llvm_zlib")
  47. # TODO(chandlerc): Replace this with an upstream release once the pull request
  48. # with our needed functionality lands:
  49. # https://github.com/jmillikin/rules_m4/pull/7
  50. #
  51. # Until then, this is pulling from that pull request's commit.
  52. http_archive(
  53. name = "rules_m4",
  54. strip_prefix = "rules_m4-add-extra-copts",
  55. sha256 = "4d34917214e8890ad770bdf0c319c41c9201fffd770938b41a1d641d4b27e05c",
  56. urls = ["https://github.com/chandlerc/rules_m4/archive/add-extra-copts.zip"],
  57. )
  58. load("@rules_m4//m4:m4.bzl", "m4_register_toolchains")
  59. # When building M4, disable all compiler warnings as we can't realistically fix
  60. # them anyways.
  61. m4_register_toolchains(extra_copts = ["-w"])
  62. # TODO(chandlerc): Replace this with an upstream release once the pull request
  63. # with our needed functionality lands:
  64. # https://github.com/jmillikin/rules_flex/pull/5
  65. #
  66. # Until then, this is pulling from that pull request's commit.
  67. http_archive(
  68. name = "rules_flex",
  69. strip_prefix = "rules_flex-add-extra-copts",
  70. sha256 = "fd97c3ae23926507be1b95158a683cd41c628d201e852a325d38b5e9f821b752",
  71. urls = ["https://github.com/chandlerc/rules_flex/archive/add-extra-copts.zip"],
  72. )
  73. load("@rules_flex//flex:flex.bzl", "flex_register_toolchains")
  74. # When building Flex, disable all compiler warnings as we can't realistically
  75. # fix them anyways.
  76. flex_register_toolchains(extra_copts = ["-w"])
  77. # TODO(chandlerc): Replace this with an upstream release once the pull request
  78. # with our needed functionality lands:
  79. # https://github.com/jmillikin/rules_bison/pull/7
  80. #
  81. # Until then, this is pulling from that pull request's commit.
  82. http_archive(
  83. name = "rules_bison",
  84. strip_prefix = "rules_bison-add-extra-copts",
  85. sha256 = "c6e926f15214d903966dc950d759ec69116db67f148be114c119e4def0551eaa",
  86. urls = ["https://github.com/chandlerc/rules_bison/archive/add-extra-copts.zip"],
  87. )
  88. load("@rules_bison//bison:bison.bzl", "bison_register_toolchains")
  89. # When building Bison, disable all compiler warnings as we can't realistically
  90. # fix them anyways.
  91. bison_register_toolchains(extra_copts = ["-w"])