• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2009-2021, Google LLC
2# All rights reserved.
3#
4# Use of this source code is governed by a BSD-style
5# license that can be found in the LICENSE file or at
6# https://developers.google.com/open-source/licenses/bsd
7
8load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
9
10package(default_applicable_licenses = ["//:license"])
11
12cc_library(
13    name = "hash",
14    srcs = [
15        "common.c",
16    ],
17    hdrs = [
18        "common.h",
19        "int_table.h",
20        "str_table.h",
21    ],
22    copts = UPB_DEFAULT_COPTS,
23    visibility = ["//visibility:public"],
24    deps = [
25        "//upb:base",
26        "//upb:mem",
27        "//upb:port",
28        "//upb/base:internal",
29    ],
30)
31
32cc_test(
33    name = "test",
34    srcs = ["test.cc"],
35    deps = [
36        ":hash",
37        "//upb:mem",
38        "//upb:port",
39        "@com_google_absl//absl/container:flat_hash_map",
40        "@com_google_googletest//:gtest",
41        "@com_google_googletest//:gtest_main",
42    ],
43)
44
45filegroup(
46    name = "source_files",
47    srcs = glob(
48        [
49            "**/*.c",
50            "**/*.h",
51        ],
52    ),
53    visibility = [
54        "//python/dist:__pkg__",
55        "//upb/cmake:__pkg__",
56    ],
57)
58
59filegroup(
60    name = "test_srcs",
61    srcs = glob(
62        [
63            "**/*test.cc",
64        ],
65    ),
66    visibility = ["//pkg:__pkg__"],
67)
68