256 lines · plain
1if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})2 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})3endif()4 5add_header_library(6 time_constants7 HDRS8 time_constants.h9 DEPENDS10 libc.hdr.stdint_proxy11 libc.hdr.types.time_t12 libc.include.time13 libc.src.__support.CPP.array14 libc.src.__support.CPP.string_view15)16 17add_object_library(18 time_utils19 SRCS20 time_utils.cpp21 HDRS22 time_utils.h23 DEPENDS24 libc.include.time25 libc.src.__support.CPP.limits26 libc.src.__support.CPP.string_view27 libc.src.__support.CPP.optional28 libc.src.errno.errno29 .time_constants30 libc.hdr.types.time_t31 libc.hdr.types.size_t32 libc.hdr.types.struct_tm33 libc.hdr.stdint_proxy34)35 36add_entrypoint_object(37 asctime38 SRCS39 asctime.cpp40 HDRS41 asctime.h42 DEPENDS43 .time_utils44 .time_constants45 libc.include.time46 libc.hdr.types.struct_tm47)48 49add_entrypoint_object(50 asctime_r51 SRCS52 asctime_r.cpp53 HDRS54 asctime_r.h55 DEPENDS56 .time_utils57 .time_constants58 libc.include.time59 libc.hdr.types.struct_tm60)61 62add_entrypoint_object(63 ctime64 SRCS65 ctime.cpp66 HDRS67 ctime.h68 DEPENDS69 .time_utils70 .time_constants71 libc.hdr.types.time_t72 libc.include.time73)74 75add_entrypoint_object(76 ctime_r77 SRCS78 ctime_r.cpp79 HDRS80 ctime_r.h81 DEPENDS82 .time_utils83 .time_constants84 libc.hdr.types.time_t85 libc.include.time86)87 88add_entrypoint_object(89 localtime90 SRCS91 localtime.cpp92 HDRS93 localtime.h94 DEPENDS95 .time_utils96 libc.hdr.types.time_t97 libc.hdr.types.struct_tm98)99 100add_entrypoint_object(101 localtime_r102 SRCS103 localtime_r.cpp104 HDRS105 localtime_r.h106 DEPENDS107 .time_utils108 libc.hdr.types.time_t109 libc.hdr.types.struct_tm110)111 112add_entrypoint_object(113 difftime114 SRCS115 difftime.cpp116 HDRS117 difftime.h118 DEPENDS119 libc.include.time120 libc.hdr.types.time_t121)122 123add_entrypoint_object(124 gmtime125 SRCS126 gmtime.cpp127 HDRS128 gmtime.h129 DEPENDS130 .time_utils131 libc.include.time132 libc.hdr.types.time_t133 libc.hdr.types.struct_tm134)135 136add_entrypoint_object(137 gmtime_r138 SRCS139 gmtime_r.cpp140 HDRS141 gmtime_r.h142 DEPENDS143 .time_utils144 libc.include.time145 libc.hdr.types.time_t146 libc.hdr.types.struct_tm147)148 149add_entrypoint_object(150 mktime151 SRCS152 mktime.cpp153 HDRS154 mktime.h155 DEPENDS156 .time_utils157 .time_constants158 libc.include.time159 libc.src.errno.errno160 libc.hdr.types.time_t161 libc.hdr.types.struct_tm162)163 164add_subdirectory(strftime_core) #TODO: Move to top165 166add_entrypoint_object(167 strftime168 SRCS169 strftime.cpp170 HDRS171 strftime.h172 DEPENDS173 libc.hdr.types.size_t174 libc.hdr.types.struct_tm175 libc.src.stdio.printf_core.writer176 libc.src.time.strftime_core.strftime_main177)178 179add_entrypoint_object(180 strftime_l181 SRCS182 strftime_l.cpp183 HDRS184 strftime_l.h185 DEPENDS186 libc.hdr.types.locale_t187 libc.hdr.types.size_t188 libc.hdr.types.struct_tm189 libc.src.stdio.printf_core.writer190 libc.src.time.strftime_core.strftime_main191)192 193add_entrypoint_object(194 time195 SRCS196 time.cpp197 HDRS198 time_func.h199 DEPENDS200 libc.hdr.time_macros201 libc.hdr.types.time_t202 libc.src.__support.time.clock_gettime203 libc.src.errno.errno204 libc.hdr.types.struct_tm205)206 207add_entrypoint_object(208 timespec_get209 ALIAS210 DEPENDS211 .${LIBC_TARGET_OS}.timespec_get212)213 214add_entrypoint_object(215 clock216 ALIAS217 DEPENDS218 .${LIBC_TARGET_OS}.clock219)220 221add_entrypoint_object(222 nanosleep223 ALIAS224 DEPENDS225 .${LIBC_TARGET_OS}.nanosleep226)227 228add_entrypoint_object(229 clock_gettime230 ALIAS231 DEPENDS232 .${LIBC_TARGET_OS}.clock_gettime233)234 235add_entrypoint_object(236 gettimeofday237 ALIAS238 DEPENDS239 .${LIBC_TARGET_OS}.gettimeofday240)241 242add_entrypoint_object(243 clock_getres244 ALIAS245 DEPENDS246 .${LIBC_TARGET_OS}.clock_getres247)248 249add_entrypoint_object(250 clock_settime251 ALIAS252 DEPENDS253 .${LIBC_TARGET_OS}.clock_settime254)255 256