WORKSPACE 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. # Add Bazel's python rules and set up pip.
  7. http_archive(
  8. name = "rules_python",
  9. sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
  10. url = "https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz",
  11. )
  12. load("@rules_python//python:pip.bzl", "pip_install")
  13. # Create a central repo that knows about the pip dependencies.
  14. pip_install(
  15. name = "py_deps",
  16. requirements = "//github_tools:requirements.txt",
  17. )
  18. # Configure the bootstrapped Clang and LLVM toolchain for Bazel.
  19. load("//bazel/cc_toolchains:clang_configuration.bzl", "configure_clang_toolchain")
  20. configure_clang_toolchain(name = "bazel_cc_toolchain")
  21. local_repository(
  22. name = "llvm_bazel",
  23. path = "third_party/llvm-bazel/llvm-bazel",
  24. )
  25. load("@llvm_bazel//:configure.bzl", "llvm_configure")
  26. llvm_configure(
  27. name = "llvm-project",
  28. src_path = "third_party/llvm-project",
  29. src_workspace = "@carbon//:WORKSPACE",
  30. targets = [
  31. "AArch64",
  32. "X86",
  33. ],
  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")
  41. # TODO(chandlerc): Replace this with an upstream release once the pull request
  42. # with our needed functionality lands:
  43. # https://github.com/jmillikin/rules_m4/pull/7
  44. #
  45. # Until then, this is pulling from that pull request's commit.
  46. http_archive(
  47. name = "rules_m4",
  48. sha256 = "4d34917214e8890ad770bdf0c319c41c9201fffd770938b41a1d641d4b27e05c",
  49. strip_prefix = "rules_m4-add-extra-copts",
  50. urls = ["https://github.com/chandlerc/rules_m4/archive/add-extra-copts.zip"],
  51. )
  52. load("@rules_m4//m4:m4.bzl", "m4_register_toolchains")
  53. # When building M4, disable all compiler warnings as we can't realistically fix
  54. # them anyways.
  55. m4_register_toolchains(extra_copts = ["-w"])
  56. # TODO(chandlerc): Replace this with an upstream release once the pull request
  57. # with our needed functionality lands:
  58. # https://github.com/jmillikin/rules_flex/pull/5
  59. #
  60. # Until then, this is pulling from that pull request's commit.
  61. http_archive(
  62. name = "rules_flex",
  63. sha256 = "fd97c3ae23926507be1b95158a683cd41c628d201e852a325d38b5e9f821b752",
  64. strip_prefix = "rules_flex-add-extra-copts",
  65. urls = ["https://github.com/chandlerc/rules_flex/archive/add-extra-copts.zip"],
  66. )
  67. load("@rules_flex//flex:flex.bzl", "flex_register_toolchains")
  68. # When building Flex, disable all compiler warnings as we can't realistically
  69. # fix them anyways.
  70. flex_register_toolchains(extra_copts = ["-w"])
  71. # TODO(chandlerc): Replace this with an upstream release once the pull request
  72. # with our needed functionality lands:
  73. # https://github.com/jmillikin/rules_bison/pull/7
  74. #
  75. # Until then, this is pulling from that pull request's commit.
  76. http_archive(
  77. name = "rules_bison",
  78. sha256 = "c6e926f15214d903966dc950d759ec69116db67f148be114c119e4def0551eaa",
  79. strip_prefix = "rules_bison-add-extra-copts",
  80. urls = ["https://github.com/chandlerc/rules_bison/archive/add-extra-copts.zip"],
  81. )
  82. load("@rules_bison//bison:bison.bzl", "bison_register_toolchains")
  83. # When building Bison, disable all compiler warnings as we can't realistically
  84. # fix them anyways.
  85. bison_register_toolchains(extra_copts = ["-w"])
  86. local_repository(
  87. name = "brotli",
  88. path = "third_party/examples/brotli/original",
  89. )
  90. new_local_repository(
  91. name = "woff2",
  92. build_file = "third_party/examples/woff2/BUILD.original",
  93. path = "third_party/examples/woff2/original",
  94. workspace_file = "third_party/examples/woff2/WORKSPACE.original",
  95. )
  96. local_repository(
  97. name = "woff2_carbon",
  98. path = "third_party/examples/woff2/carbon",
  99. )