1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 05:34:58 +00:00
serenity/Userland/Libraries/LibTimeZone/CMakeLists.txt
Timothy Flynn 350fdf1e43 LibCore+LibTimeZone: Support time zone names in Core::DateTime::parse
LibCore currently cannot depend on LibTimeZone directly. All build-time
code generators depend on LibCore, so there'd be a circular dependency:
LibCore -> LibTimeZone -> GenerateTZData -> LibCore.

So to support parsing time zone names and applying their offsets, add a
couple of weakly-defined helper functions. These work similar to the way
AK::String declares some methods that LibUnicode defines. Any user who
wants to parse time zone names (from outside of LibCore itself) can link
against LibTimeZone to receive full support.
2023-11-08 09:28:17 +01:00

19 lines
732 B
CMake

include(${SerenityOS_SOURCE_DIR}/Meta/CMake/time_zone_data.cmake)
set(SOURCES
${TIME_ZONE_DATA_SOURCES}
DateTime.cpp
TimeZone.cpp
)
set(GENERATED_SOURCES ${CURRENT_LIB_GENERATED})
add_library(LibTimeZone OBJECT ${SOURCES})
serenity_generated_sources(LibTimeZone)
target_compile_definitions(LibTimeZone PRIVATE ENABLE_TIME_ZONE_DATA=$<BOOL:${ENABLE_TIME_ZONE_DATABASE_DOWNLOAD}>)
# NOTE: These objects are used by the DynamicLoader, which is always built without coverage instrumentation.
# We could allow them to be instrumented for coverage if DynamicLoader built its own copy
target_link_libraries(LibTimeZone PRIVATE NoCoverage)
if (SERENITYOS)
add_dependencies(LibTimeZone install_libc_headers)
endif()