xref: /aosp_15_r20/external/abseil-cpp/absl/time/CMakeLists.txt (revision 9356374a3709195abf420251b3e825997ff56c0f)
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
57absl_cc_library(
58  NAME
59    time_zone
60  HDRS
61    "internal/cctz/include/cctz/time_zone.h"
62    "internal/cctz/include/cctz/zone_info_source.h"
63  SRCS
64    "internal/cctz/src/time_zone_fixed.cc"
65    "internal/cctz/src/time_zone_fixed.h"
66    "internal/cctz/src/time_zone_format.cc"
67    "internal/cctz/src/time_zone_if.cc"
68    "internal/cctz/src/time_zone_if.h"
69    "internal/cctz/src/time_zone_impl.cc"
70    "internal/cctz/src/time_zone_impl.h"
71    "internal/cctz/src/time_zone_info.cc"
72    "internal/cctz/src/time_zone_info.h"
73    "internal/cctz/src/time_zone_libc.cc"
74    "internal/cctz/src/time_zone_libc.h"
75    "internal/cctz/src/time_zone_lookup.cc"
76    "internal/cctz/src/time_zone_posix.cc"
77    "internal/cctz/src/time_zone_posix.h"
78    "internal/cctz/src/tzfile.h"
79    "internal/cctz/src/zone_info_source.cc"
80  COPTS
81    ${ABSL_DEFAULT_COPTS}
82  DEPS
83    Threads::Threads
84    # TODO(#1495): Use $<LINK_LIBRARY:FRAMEWORK,CoreFoundation> once our
85    # minimum CMake version >= 3.24
86    $<$<PLATFORM_ID:Darwin,iOS,tvOS,visionOS,watchOS>:-Wl,-framework,CoreFoundation>
87)
88
89# Internal-only target, do not depend on directly.
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  COPTS
98    ${ABSL_DEFAULT_COPTS}
99  DEPS
100    absl::time
101    absl::config
102    absl::raw_logging_internal
103    absl::time_zone
104  TESTONLY
105)
106
107absl_cc_test(
108  NAME
109    time_test
110  SRCS
111    "civil_time_test.cc"
112    "clock_test.cc"
113    "duration_test.cc"
114    "format_test.cc"
115    "time_test.cc"
116    "time_zone_test.cc"
117  COPTS
118    ${ABSL_TEST_COPTS}
119  DEPS
120    absl::time_internal_test_util
121    absl::time
122    absl::config
123    absl::core_headers
124    absl::strings
125    absl::str_format
126    absl::time_zone
127    GTest::gmock_main
128)
129
130absl_cc_test(
131  NAME
132    flag_test
133  SRCS
134    "flag_test.cc"
135  COPTS
136    ${ABSL_TEST_COPTS}
137  DEPS
138    absl::flags
139    absl::flags_reflection
140    GTest::gmock_main
141)
142