2023-08-14 11:04:42 -07:00
|
|
|
# Copyright (c) 2009-2021, Google LLC
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
2023-09-08 17:13:09 -07:00
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file or at
|
|
|
|
# https://developers.google.com/open-source/licenses/bsd
|
2023-08-14 11:04:42 -07:00
|
|
|
|
2024-04-03 01:34:28 -07:00
|
|
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
2023-08-14 11:04:42 -07:00
|
|
|
|
2024-01-11 10:14:29 -08:00
|
|
|
# begin:google_only
|
|
|
|
# package(default_applicable_licenses = ["//upb:license"])
|
|
|
|
# end:google_only
|
|
|
|
|
2023-08-14 11:04:42 -07:00
|
|
|
cc_library(
|
|
|
|
name = "hash",
|
|
|
|
srcs = [
|
|
|
|
"common.c",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"common.h",
|
|
|
|
"int_table.h",
|
|
|
|
"str_table.h",
|
|
|
|
],
|
|
|
|
copts = UPB_DEFAULT_COPTS,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
2023-09-12 13:06:39 -07:00
|
|
|
"//upb:base",
|
|
|
|
"//upb:mem",
|
|
|
|
"//upb:port",
|
2023-12-28 10:38:18 -08:00
|
|
|
"//upb/base:internal",
|
2023-08-14 11:04:42 -07:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "test",
|
|
|
|
srcs = ["test.cc"],
|
|
|
|
deps = [
|
|
|
|
":hash",
|
2023-09-12 13:06:39 -07:00
|
|
|
"//upb:mem",
|
|
|
|
"//upb:port",
|
2023-08-21 17:27:30 -07:00
|
|
|
"@com_google_absl//absl/container:flat_hash_map",
|
2023-12-28 14:40:25 -08:00
|
|
|
"@com_google_googletest//:gtest",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
2023-08-14 11:04:42 -07:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
# begin:github_only
|
|
|
|
filegroup(
|
|
|
|
name = "source_files",
|
|
|
|
srcs = glob(
|
|
|
|
[
|
|
|
|
"**/*.c",
|
|
|
|
"**/*.h",
|
|
|
|
],
|
|
|
|
),
|
|
|
|
visibility = [
|
2023-09-26 14:36:20 -07:00
|
|
|
"//python/dist:__pkg__",
|
2023-12-28 14:40:25 -08:00
|
|
|
"//upb/cmake:__pkg__",
|
|
|
|
],
|
2023-08-14 11:04:42 -07:00
|
|
|
)
|
|
|
|
# end:github_only
|
2023-12-26 14:10:05 -08:00
|
|
|
|
|
|
|
# begin:github_only
|
|
|
|
filegroup(
|
|
|
|
name = "test_srcs",
|
|
|
|
srcs = glob(
|
|
|
|
[
|
|
|
|
"**/*test.cc",
|
|
|
|
],
|
|
|
|
),
|
|
|
|
visibility = ["//pkg:__pkg__"],
|
|
|
|
)
|
|
|
|
# end:github_only
|