Austin Schuh | 36244a1 | 2019-09-21 17:52:38 -0700 | [diff] [blame] | 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 | |
| 15 | load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") |
| 16 | load( |
| 17 | "//absl:copts/configure_copts.bzl", |
| 18 | "ABSL_DEFAULT_COPTS", |
| 19 | "ABSL_DEFAULT_LINKOPTS", |
| 20 | "ABSL_TEST_COPTS", |
| 21 | ) |
| 22 | |
| 23 | package(default_visibility = ["//visibility:public"]) |
| 24 | |
Austin Schuh | b4691e9 | 2020-12-31 12:37:18 -0800 | [diff] [blame] | 25 | licenses(["notice"]) |
| 26 | |
| 27 | cc_library( |
| 28 | name = "bits", |
| 29 | hdrs = [ |
| 30 | "bits.h", |
| 31 | "internal/bits.h", |
| 32 | ], |
| 33 | copts = ABSL_DEFAULT_COPTS, |
| 34 | linkopts = ABSL_DEFAULT_LINKOPTS, |
| 35 | deps = [ |
| 36 | "//absl/base:config", |
| 37 | "//absl/base:core_headers", |
| 38 | ], |
| 39 | ) |
| 40 | |
| 41 | cc_test( |
| 42 | name = "bits_test", |
| 43 | size = "small", |
| 44 | srcs = [ |
| 45 | "bits_test.cc", |
| 46 | ], |
| 47 | copts = ABSL_TEST_COPTS, |
| 48 | linkopts = ABSL_DEFAULT_LINKOPTS, |
| 49 | deps = [ |
| 50 | ":bits", |
| 51 | "//absl/random", |
| 52 | "@com_google_googletest//:gtest_main", |
| 53 | ], |
| 54 | ) |
Austin Schuh | 36244a1 | 2019-09-21 17:52:38 -0700 | [diff] [blame] | 55 | |
| 56 | cc_library( |
| 57 | name = "int128", |
| 58 | srcs = [ |
| 59 | "int128.cc", |
| 60 | "int128_have_intrinsic.inc", |
| 61 | "int128_no_intrinsic.inc", |
| 62 | ], |
| 63 | hdrs = ["int128.h"], |
| 64 | copts = ABSL_DEFAULT_COPTS, |
| 65 | linkopts = ABSL_DEFAULT_LINKOPTS, |
| 66 | deps = [ |
Austin Schuh | b4691e9 | 2020-12-31 12:37:18 -0800 | [diff] [blame] | 67 | ":bits", |
Austin Schuh | 36244a1 | 2019-09-21 17:52:38 -0700 | [diff] [blame] | 68 | "//absl/base:config", |
| 69 | "//absl/base:core_headers", |
| 70 | ], |
| 71 | ) |
| 72 | |
| 73 | cc_test( |
| 74 | name = "int128_test", |
| 75 | size = "small", |
| 76 | srcs = [ |
| 77 | "int128_stream_test.cc", |
| 78 | "int128_test.cc", |
| 79 | ], |
| 80 | copts = ABSL_TEST_COPTS, |
| 81 | linkopts = ABSL_DEFAULT_LINKOPTS, |
| 82 | deps = [ |
| 83 | ":int128", |
| 84 | "//absl/base", |
| 85 | "//absl/base:core_headers", |
| 86 | "//absl/hash:hash_testing", |
| 87 | "//absl/meta:type_traits", |
| 88 | "@com_google_googletest//:gtest_main", |
| 89 | ], |
| 90 | ) |
| 91 | |
| 92 | cc_test( |
| 93 | name = "int128_benchmark", |
| 94 | srcs = ["int128_benchmark.cc"], |
| 95 | copts = ABSL_TEST_COPTS, |
| 96 | linkopts = ABSL_DEFAULT_LINKOPTS, |
| 97 | tags = ["benchmark"], |
| 98 | deps = [ |
| 99 | ":int128", |
| 100 | "//absl/base:config", |
| 101 | "@com_github_google_benchmark//:benchmark_main", |
| 102 | ], |
| 103 | ) |