BUILD.bazel 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Copyright 2009 The RE2 Authors. All Rights Reserved.
  2. # Use of this source code is governed by a BSD-style
  3. # license that can be found in the LICENSE file.
  4. # Bazel (http://bazel.build/) BUILD file for RE2 Python.
  5. load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
  6. load("@rules_python//python:defs.bzl", "py_library", "py_test")
  7. pybind_extension(
  8. name = "_re2",
  9. srcs = ["_re2.cc"],
  10. deps = [
  11. "//:re2",
  12. "@abseil-cpp//absl/strings",
  13. ],
  14. )
  15. py_library(
  16. name = "re2",
  17. srcs = ["re2.py"],
  18. data = [":_re2"],
  19. imports = ["."],
  20. visibility = ["//visibility:public"],
  21. )
  22. py_test(
  23. name = "re2_test",
  24. size = "small",
  25. srcs = ["re2_test.py"],
  26. deps = [
  27. ":re2",
  28. "@abseil-py//absl/testing:absltest",
  29. "@abseil-py//absl/testing:parameterized",
  30. ],
  31. )
  32. # These are implementation details for `setup.py`, so they can be
  33. # named however we want. For now, they are named to be consistent
  34. # with the `--cpu` flag values that they will eventually replace.
  35. platform(
  36. name = "darwin_x86_64",
  37. constraint_values = [
  38. "@platforms//cpu:x86_64",
  39. "@platforms//os:macos",
  40. ],
  41. )
  42. platform(
  43. name = "darwin_arm64",
  44. constraint_values = [
  45. "@platforms//cpu:arm64",
  46. "@platforms//os:macos",
  47. ],
  48. )
  49. platform(
  50. name = "x64_x86_windows",
  51. constraint_values = [
  52. "@platforms//cpu:x86_32",
  53. "@platforms//os:windows",
  54. ],
  55. )
  56. platform(
  57. name = "x64_windows",
  58. constraint_values = [
  59. "@platforms//cpu:x86_64",
  60. "@platforms//os:windows",
  61. ],
  62. )