BUILD.bazel 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. # Copyright 2018 The Abseil Authors.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # https://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. load(
  15. "//absl:copts/configure_copts.bzl",
  16. "ABSL_DEFAULT_COPTS",
  17. "ABSL_DEFAULT_LINKOPTS",
  18. "ABSL_TEST_COPTS",
  19. )
  20. package(
  21. default_visibility = ["//visibility:public"],
  22. features = [
  23. "header_modules",
  24. "layering_check",
  25. "parse_headers",
  26. ],
  27. )
  28. licenses(["notice"])
  29. cc_library(
  30. name = "bits",
  31. hdrs = [
  32. "bits.h",
  33. "internal/bits.h",
  34. ],
  35. copts = ABSL_DEFAULT_COPTS,
  36. linkopts = ABSL_DEFAULT_LINKOPTS,
  37. deps = [
  38. "//absl/base:config",
  39. "//absl/base:core_headers",
  40. ],
  41. )
  42. cc_binary(
  43. name = "bits_benchmark",
  44. testonly = True,
  45. srcs = ["bits_benchmark.cc"],
  46. copts = ABSL_DEFAULT_COPTS,
  47. linkopts = ABSL_DEFAULT_LINKOPTS,
  48. deps = [
  49. ":bits",
  50. "//absl/base:core_headers",
  51. "//absl/random",
  52. "@com_github_google_benchmark//:benchmark_main",
  53. "@com_google_googletest//:gtest",
  54. ],
  55. )
  56. cc_test(
  57. name = "bits_test",
  58. size = "small",
  59. srcs = [
  60. "bits_test.cc",
  61. ],
  62. copts = ABSL_TEST_COPTS,
  63. linkopts = ABSL_DEFAULT_LINKOPTS,
  64. deps = [
  65. ":bits",
  66. "//absl/random",
  67. "@com_google_googletest//:gtest",
  68. "@com_google_googletest//:gtest_main",
  69. ],
  70. )
  71. cc_library(
  72. name = "int128",
  73. srcs = [
  74. "int128.cc",
  75. "int128_have_intrinsic.inc",
  76. "int128_no_intrinsic.inc",
  77. ],
  78. hdrs = ["int128.h"],
  79. copts = ABSL_DEFAULT_COPTS,
  80. linkopts = ABSL_DEFAULT_LINKOPTS,
  81. deps = [
  82. ":bits",
  83. "//absl/base:config",
  84. "//absl/base:core_headers",
  85. "//absl/types:compare",
  86. ],
  87. )
  88. cc_test(
  89. name = "int128_test",
  90. size = "small",
  91. srcs = [
  92. "int128_stream_test.cc",
  93. "int128_test.cc",
  94. ],
  95. copts = ABSL_TEST_COPTS,
  96. linkopts = ABSL_DEFAULT_LINKOPTS,
  97. deps = [
  98. ":int128",
  99. "//absl/base",
  100. "//absl/hash:hash_testing",
  101. "//absl/meta:type_traits",
  102. "//absl/strings",
  103. "//absl/types:compare",
  104. "@com_google_googletest//:gtest",
  105. "@com_google_googletest//:gtest_main",
  106. ],
  107. )
  108. cc_test(
  109. name = "int128_benchmark",
  110. srcs = ["int128_benchmark.cc"],
  111. copts = ABSL_TEST_COPTS,
  112. linkopts = ABSL_DEFAULT_LINKOPTS,
  113. tags = ["benchmark"],
  114. deps = [
  115. ":int128",
  116. "//absl/base:config",
  117. "@com_github_google_benchmark//:benchmark_main",
  118. "@com_google_googletest//:gtest",
  119. ],
  120. )
  121. cc_library(
  122. name = "representation",
  123. hdrs = [
  124. "internal/representation.h",
  125. ],
  126. copts = ABSL_DEFAULT_COPTS,
  127. linkopts = ABSL_DEFAULT_LINKOPTS,
  128. deps = [
  129. "//absl/base:config",
  130. ],
  131. )