1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 05:07:45 +00:00

LibTimeZone+Meta: Add plumbing for an IANA Time Zone Database generator

The IANA Time Zone Database contains data needed, at least, for various
JavaScript objects. This adds plumbing for a parser and code generator
for this data. The generated data will be made available by LibTimeZone,
much like how UCD and CLDR data is available through LibUnicode.
This commit is contained in:
Timothy Flynn 2021-12-22 16:33:38 -05:00 committed by Linus Groh
parent 9ba386a7bb
commit 8669b25cea
8 changed files with 184 additions and 6 deletions

View file

@ -216,6 +216,11 @@ function(lagom_test source)
)
endfunction()
if (NOT TARGET all_generated)
# Meta target to run all code-gen steps in the build.
add_custom_target(all_generated)
endif()
# AK/Core
# Note: AK is included in LagomCore for the host build instead of LibC per the target build
file(GLOB AK_SOURCES CONFIGURE_DEPENDS "../../AK/*.cpp")
@ -240,6 +245,19 @@ if (APPLE)
target_link_options(LagomMain PRIVATE -undefined dynamic_lookup)
endif()
# TimeZone
# This is needed even if Lagom is not enabled because it is depended upon by code generators.
if (NOT ENABLE_OSS_FUZZ AND NOT ENABLE_FUZZER_SANITIZER)
include(time_zone_data)
else()
set(ENABLE_TIME_ZONE_DATABASE_DOWNLOAD OFF)
endif()
file(GLOB LIBTIMEZONE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTimeZone/*.cpp")
lagom_lib(TimeZone timezone
SOURCES ${LIBTIMEZONE_SOURCES} ${TIME_ZONE_DATA_SOURCES}
)
target_compile_definitions(LagomTimeZone PRIVATE ENABLE_TIME_ZONE_DATA=$<BOOL:${ENABLE_TIME_ZONE_DATABASE_DOWNLOAD}>)
# Manually install AK headers
install(
DIRECTORY "${SERENITY_PROJECT_ROOT}/AK"
@ -255,12 +273,6 @@ if (NOT ENABLE_OSS_FUZZ AND NOT ENABLE_FUZZER_SANITIZER)
endif()
if (BUILD_LAGOM)
if (NOT TARGET all_generated)
# Meta target to run all code-gen steps in the build.
add_custom_target(all_generated)
endif()
# Lagom Libraries
# Archive