1# Copyright 2016 Google Inc. All Rights Reserved. 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 15package(features = ["-parse_headers"]) 16 17licenses(["notice"]) 18 19### libraries 20 21cc_library( 22 name = "civil_time", 23 srcs = ["src/civil_time_detail.cc"], 24 hdrs = [ 25 "include/cctz/civil_time.h", 26 ], 27 textual_hdrs = ["include/cctz/civil_time_detail.h"], 28 visibility = ["//visibility:public"], 29 deps = ["//absl/base:config"], 30) 31 32cc_library( 33 name = "time_zone", 34 srcs = [ 35 "src/time_zone_fixed.cc", 36 "src/time_zone_fixed.h", 37 "src/time_zone_format.cc", 38 "src/time_zone_if.cc", 39 "src/time_zone_if.h", 40 "src/time_zone_impl.cc", 41 "src/time_zone_impl.h", 42 "src/time_zone_info.cc", 43 "src/time_zone_info.h", 44 "src/time_zone_libc.cc", 45 "src/time_zone_libc.h", 46 "src/time_zone_lookup.cc", 47 "src/time_zone_posix.cc", 48 "src/time_zone_posix.h", 49 "src/tzfile.h", 50 "src/zone_info_source.cc", 51 ], 52 hdrs = [ 53 "include/cctz/time_zone.h", 54 "include/cctz/zone_info_source.h", 55 ], 56 linkopts = select({ 57 "@platforms//os:osx": ["-Wl,-framework,CoreFoundation"], 58 "@platforms//os:ios": ["-Wl,-framework,CoreFoundation"], 59 "//conditions:default": [], 60 }), 61 visibility = ["//visibility:public"], 62 deps = [ 63 ":civil_time", 64 "//absl/base:config", 65 ] + select( 66 { 67 "//conditions:default": [], 68 }, 69 ), 70) 71 72### tests 73 74test_suite( 75 name = "all_tests", 76 visibility = ["//visibility:public"], 77) 78 79cc_test( 80 name = "civil_time_test", 81 size = "small", 82 srcs = ["src/civil_time_test.cc"], 83 deps = [ 84 ":civil_time", 85 "//absl/base:config", 86 "@com_google_googletest//:gtest_main", 87 ], 88) 89 90cc_test( 91 name = "time_zone_format_test", 92 size = "small", 93 srcs = ["src/time_zone_format_test.cc"], 94 data = [":zoneinfo"], 95 env = {"TZDIR": "absl/time/internal/cctz/testdata/zoneinfo"}, 96 tags = [ 97 "no_test_android_arm", 98 "no_test_android_arm64", 99 "no_test_android_x86", 100 "no_test_wasm", 101 ], 102 deps = [ 103 ":civil_time", 104 ":time_zone", 105 "//absl/base:config", 106 "@com_google_googletest//:gtest_main", 107 ], 108) 109 110cc_test( 111 name = "time_zone_lookup_test", 112 size = "small", 113 timeout = "moderate", 114 srcs = ["src/time_zone_lookup_test.cc"], 115 data = [":zoneinfo"], 116 env = {"TZDIR": "absl/time/internal/cctz/testdata/zoneinfo"}, 117 tags = [ 118 "no_test_android_arm", 119 "no_test_android_arm64", 120 "no_test_android_x86", 121 "no_test_wasm", 122 ], 123 deps = [ 124 ":civil_time", 125 ":time_zone", 126 "//absl/base:config", 127 "@com_google_googletest//:gtest_main", 128 ], 129) 130 131### benchmarks 132 133cc_test( 134 name = "cctz_benchmark", 135 srcs = [ 136 "src/cctz_benchmark.cc", 137 "src/time_zone_if.h", 138 "src/time_zone_impl.h", 139 "src/time_zone_info.h", 140 "src/tzfile.h", 141 ], 142 linkstatic = 1, 143 tags = ["benchmark"], 144 deps = [ 145 ":civil_time", 146 ":time_zone", 147 "//absl/base:config", 148 "@com_github_google_benchmark//:benchmark_main", 149 ], 150) 151 152filegroup( 153 name = "zoneinfo", 154 srcs = glob(["testdata/zoneinfo/**"]), 155 visibility = ["//absl/time:__subpackages__"], 156) 157 158### examples 159 160### binaries 161