blob: e09e52d21fe6afa9a496f6c88281dd4d767536e5 [file] [log] [blame]
Austin Schuh36244a12019-09-21 17:52:38 -07001# 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
15load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
16load(
17 "//absl:copts/configure_copts.bzl",
18 "ABSL_DEFAULT_COPTS",
19 "ABSL_DEFAULT_LINKOPTS",
20 "ABSL_TEST_COPTS",
21)
22
23package(default_visibility = ["//visibility:public"])
24
25licenses(["notice"]) # Apache 2.0
26
27cc_library(
28 name = "int128",
29 srcs = [
30 "int128.cc",
31 "int128_have_intrinsic.inc",
32 "int128_no_intrinsic.inc",
33 ],
34 hdrs = ["int128.h"],
35 copts = ABSL_DEFAULT_COPTS,
36 linkopts = ABSL_DEFAULT_LINKOPTS,
37 deps = [
38 "//absl/base:config",
39 "//absl/base:core_headers",
40 ],
41)
42
43cc_test(
44 name = "int128_test",
45 size = "small",
46 srcs = [
47 "int128_stream_test.cc",
48 "int128_test.cc",
49 ],
50 copts = ABSL_TEST_COPTS,
51 linkopts = ABSL_DEFAULT_LINKOPTS,
52 deps = [
53 ":int128",
54 "//absl/base",
55 "//absl/base:core_headers",
56 "//absl/hash:hash_testing",
57 "//absl/meta:type_traits",
58 "@com_google_googletest//:gtest_main",
59 ],
60)
61
62cc_test(
63 name = "int128_benchmark",
64 srcs = ["int128_benchmark.cc"],
65 copts = ABSL_TEST_COPTS,
66 linkopts = ABSL_DEFAULT_LINKOPTS,
67 tags = ["benchmark"],
68 deps = [
69 ":int128",
70 "//absl/base:config",
71 "@com_github_google_benchmark//:benchmark_main",
72 ],
73)