• 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
90# Internal-only target, do not depend on directly.
91absl_cc_library(
92  NAME
93    time_internal_test_util
94  HDRS
95    "internal/test_util.h"
96  SRCS
97    "internal/test_util.cc"
98    "internal/zoneinfo.inc"
99  COPTS
100    ${ABSL_DEFAULT_COPTS}
101  DEPS
102    absl::time
103    absl::config
104    absl::raw_logging_internal
105    absl::time_zone
106    GTest::gmock
107  TESTONLY
108)
109
110absl_cc_test(
111  NAME
112    time_test
113  SRCS
114    "civil_time_test.cc"
115    "clock_test.cc"
116    "duration_test.cc"
117    "format_test.cc"
118    "time_test.cc"
119    "time_zone_test.cc"
120  COPTS
121    ${ABSL_TEST_COPTS}
122  DEPS
123    absl::time_internal_test_util
124    absl::time
125    absl::config
126    absl::core_headers
127    absl::time_zone
128    GTest::gmock_main
129)
130
131absl_cc_test(
132  NAME
133    flag_test
134  SRCS
135    "flag_test.cc"
136  COPTS
137    ${ABSL_TEST_COPTS}
138  DEPS
139    absl::flags
140    absl::flags_reflection
141    GTest::gmock_main
142)
143