WORKSPACE 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. # Set up necessary dependencies for working with the foreign C++ rules.
  14. load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
  15. rules_foreign_cc_dependencies()
  16. # Detect and configure a Clang and LLVM based toolchain.
  17. load("//bazel/cc_toolchains:clang_detection.bzl", "detect_clang_toolchain")
  18. detect_clang_toolchain(name = "bazel_cc_toolchain")
  19. local_repository(
  20. name = "llvm_bazel",
  21. path = "third_party/llvm-bazel/llvm-bazel",
  22. )
  23. load("@llvm_bazel//:configure.bzl", "llvm_configure")
  24. llvm_configure(
  25. name = "llvm-project",
  26. src_path = "third_party/llvm-project",
  27. src_workspace = "@carbon//:WORKSPACE",
  28. )
  29. load("@llvm_bazel//:terminfo.bzl", "llvm_terminfo_system")
  30. # We require successful detection and use of a system terminfo library.
  31. llvm_terminfo_system(name = "llvm_terminfo")
  32. load("@llvm_bazel//:zlib.bzl", "llvm_zlib_system")
  33. # We require successful detection and use of a system zlib library.
  34. llvm_zlib_system(name = "llvm_zlib")