WORKSPACE 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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-master",
  11. url = "https://github.com/bazelbuild/rules_foreign_cc/archive/master.zip",
  12. )
  13. # Add Bazel's python rules.
  14. http_archive(
  15. name = "rules_python",
  16. url = "https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz",
  17. sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
  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. # Detect and configure a Clang and LLVM based toolchain.
  23. load("//bazel/cc_toolchains:clang_detection.bzl", "detect_clang_toolchain")
  24. detect_clang_toolchain(name = "bazel_cc_toolchain")
  25. local_repository(
  26. name = "llvm_bazel",
  27. path = "third_party/llvm-bazel/llvm-bazel",
  28. )
  29. load("@llvm_bazel//:configure.bzl", "llvm_configure")
  30. llvm_configure(
  31. name = "llvm-project",
  32. src_path = "third_party/llvm-project",
  33. src_workspace = "@carbon//:WORKSPACE",
  34. )
  35. load("@llvm_bazel//:terminfo.bzl", "llvm_terminfo_system")
  36. # We require successful detection and use of a system terminfo library.
  37. llvm_terminfo_system(name = "llvm_terminfo")
  38. load("@llvm_bazel//:zlib.bzl", "llvm_zlib_system")
  39. # We require successful detection and use of a system zlib library.
  40. llvm_zlib_system(name = "llvm_zlib")