BUILD.bazel (3162B)
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( 16 "//absl:copts/configure_copts.bzl", 17 "ABSL_DEFAULT_COPTS", 18 "ABSL_DEFAULT_LINKOPTS", 19 "ABSL_TEST_COPTS", 20 ) 21 22 package( 23 default_visibility = ["//visibility:public"], 24 features = [ 25 "header_modules", 26 "layering_check", 27 "parse_headers", 28 ], 29 ) 30 31 licenses(["notice"]) 32 33 cc_library( 34 name = "bits", 35 hdrs = [ 36 "bits.h", 37 "internal/bits.h", 38 ], 39 copts = ABSL_DEFAULT_COPTS, 40 linkopts = ABSL_DEFAULT_LINKOPTS, 41 deps = [ 42 "//absl/base:config", 43 "//absl/base:core_headers", 44 "//absl/base:endian", 45 ], 46 ) 47 48 cc_binary( 49 name = "bits_benchmark", 50 testonly = True, 51 srcs = ["bits_benchmark.cc"], 52 copts = ABSL_DEFAULT_COPTS, 53 linkopts = ABSL_DEFAULT_LINKOPTS, 54 deps = [ 55 ":bits", 56 "//absl/base:core_headers", 57 "//absl/random", 58 "@google_benchmark//:benchmark_main", 59 ], 60 ) 61 62 cc_test( 63 name = "bits_test", 64 size = "small", 65 srcs = [ 66 "bits_test.cc", 67 ], 68 copts = ABSL_TEST_COPTS, 69 linkopts = ABSL_DEFAULT_LINKOPTS, 70 deps = [ 71 ":bits", 72 "//absl/random", 73 "@googletest//:gtest", 74 "@googletest//:gtest_main", 75 ], 76 ) 77 78 cc_library( 79 name = "int128", 80 srcs = [ 81 "int128.cc", 82 "int128_have_intrinsic.inc", 83 "int128_no_intrinsic.inc", 84 ], 85 hdrs = ["int128.h"], 86 copts = ABSL_DEFAULT_COPTS, 87 linkopts = ABSL_DEFAULT_LINKOPTS, 88 deps = [ 89 ":bits", 90 "//absl/base:config", 91 "//absl/base:core_headers", 92 "//absl/types:compare", 93 ], 94 ) 95 96 cc_test( 97 name = "int128_test", 98 size = "small", 99 srcs = [ 100 "int128_stream_test.cc", 101 "int128_test.cc", 102 ], 103 copts = ABSL_TEST_COPTS, 104 linkopts = ABSL_DEFAULT_LINKOPTS, 105 deps = [ 106 ":int128", 107 "//absl/base", 108 "//absl/hash:hash_testing", 109 "//absl/meta:type_traits", 110 "//absl/strings", 111 "//absl/types:compare", 112 "@googletest//:gtest", 113 "@googletest//:gtest_main", 114 ], 115 ) 116 117 cc_binary( 118 name = "int128_benchmark", 119 testonly = True, 120 srcs = ["int128_benchmark.cc"], 121 copts = ABSL_TEST_COPTS, 122 linkopts = ABSL_DEFAULT_LINKOPTS, 123 tags = ["benchmark"], 124 deps = [ 125 ":int128", 126 "//absl/base:config", 127 "@google_benchmark//:benchmark_main", 128 ], 129 ) 130 131 cc_library( 132 name = "representation", 133 hdrs = [ 134 "internal/representation.h", 135 ], 136 copts = ABSL_DEFAULT_COPTS, 137 linkopts = ABSL_DEFAULT_LINKOPTS, 138 deps = [ 139 "//absl/base:config", 140 ], 141 )