• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright 2017 The Abseil Authors.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      https://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17absl_cc_library(
18  NAME
19    time
20  HDRS
21    "civil_time.h"
22    "clock.h"
23    "time.h"
24  SRCS
25    "civil_time.cc"
26    "clock.cc"
27    "duration.cc"
28    "format.cc"
29    "internal/get_current_time_chrono.inc"
30    "internal/get_current_time_posix.inc"
31    "time.cc"
32  COPTS
33    ${ABSL_DEFAULT_COPTS}
34  DEPS
35    absl::base
36    absl::civil_time
37    absl::core_headers
38    absl::int128
39    absl::raw_logging_internal
40    absl::strings
41    absl::time_zone
42  PUBLIC
43)
44
45absl_cc_library(
46  NAME
47    civil_time
48  HDRS
49    "internal/cctz/include/cctz/civil_time.h"
50    "internal/cctz/include/cctz/civil_time_detail.h"
51  SRCS
52  "internal/cctz/src/civil_time_detail.cc"
53  COPTS
54    ${ABSL_DEFAULT_COPTS}
55)
56
57if(APPLE)
58  find_library(CoreFoundation CoreFoundation)
59endif()
60
61absl_cc_library(
62  NAME
63    time_zone
64  HDRS
65    "internal/cctz/include/cctz/time_zone.h"
66    "internal/cctz/include/cctz/zone_info_source.h"
67  SRCS
68    "internal/cctz/src/time_zone_fixed.cc"
69    "internal/cctz/src/time_zone_fixed.h"
70    "internal/cctz/src/time_zone_format.cc"
71    "internal/cctz/src/time_zone_if.cc"
72    "internal/cctz/src/time_zone_if.h"
73    "internal/cctz/src/time_zone_impl.cc"
74    "internal/cctz/src/time_zone_impl.h"
75    "internal/cctz/src/time_zone_info.cc"
76    "internal/cctz/src/time_zone_info.h"
77    "internal/cctz/src/time_zone_libc.cc"
78    "internal/cctz/src/time_zone_libc.h"
79    "internal/cctz/src/time_zone_lookup.cc"
80    "internal/cctz/src/time_zone_posix.cc"
81    "internal/cctz/src/time_zone_posix.h"
82    "internal/cctz/src/tzfile.h"
83    "internal/cctz/src/zone_info_source.cc"
84  COPTS
85    ${ABSL_DEFAULT_COPTS}
86  DEPS
87    $<$<PLATFORM_ID:Darwin>:${CoreFoundation}>
88)
89
90absl_cc_library(
91  NAME
92    time_internal_test_util
93  HDRS
94    "internal/test_util.h"
95  SRCS
96    "internal/test_util.cc"
97    "internal/zoneinfo.inc"
98  COPTS
99    ${ABSL_DEFAULT_COPTS}
100  DEPS
101    absl::time
102    absl::config
103    absl::raw_logging_internal
104    absl::time_zone
105    gmock
106  TESTONLY
107)
108
109absl_cc_test(
110  NAME
111    time_test
112  SRCS
113    "civil_time_test.cc"
114    "clock_test.cc"
115    "duration_test.cc"
116    "format_test.cc"
117    "time_test.cc"
118    "time_zone_test.cc"
119  COPTS
120    ${ABSL_TEST_COPTS}
121  DEPS
122    absl::time_internal_test_util
123    absl::time
124    absl::config
125    absl::core_headers
126    absl::time_zone
127    gmock_main
128)
129