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
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"])
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:bits",
39        "//absl/base:config",
40        "//absl/base:core_headers",
41    ],
42)
43
44cc_test(
45    name = "int128_test",
46    size = "small",
47    srcs = [
48        "int128_stream_test.cc",
49        "int128_test.cc",
50    ],
51    copts = ABSL_TEST_COPTS,
52    linkopts = ABSL_DEFAULT_LINKOPTS,
53    deps = [
54        ":int128",
55        "//absl/base",
56        "//absl/base:core_headers",
57        "//absl/hash:hash_testing",
58        "//absl/meta:type_traits",
59        "@com_google_googletest//:gtest_main",
60    ],
61)
62
63cc_test(
64    name = "int128_benchmark",
65    srcs = ["int128_benchmark.cc"],
66    copts = ABSL_TEST_COPTS,
67    linkopts = ABSL_DEFAULT_LINKOPTS,
68    tags = ["benchmark"],
69    deps = [
70        ":int128",
71        "//absl/base:config",
72        "@com_github_google_benchmark//:benchmark_main",
73    ],
74)
75