LibTimeZone: Exclude from the tools build and switch to a shared library

It is not needed by code generators anymore, so it is not needed in the
Lagom tools build. And it is not needed as an object library anymore; it
was created this way so it could be included in Serenity's LibC.
This commit is contained in:
Timothy Flynn 2024-06-23 16:51:58 -04:00 committed by Andreas Kling
parent 0b753dcb44
commit be0dca8da3
Notes: sideshowbarker 2024-07-17 05:13:53 +09:00
2 changed files with 3 additions and 15 deletions

View file

@ -348,12 +348,6 @@ add_serenity_subdirectory(Userland/Libraries/LibMain)
# This is needed even if Lagom is not enabled because it is depended upon by code generators.
add_serenity_subdirectory(Userland/Libraries/LibFileSystem)
# LibTimeZone
# This is needed even if Lagom is not enabled because it is depended upon by code generators.
add_serenity_subdirectory(Userland/Libraries/LibTimeZone)
# We need an install rule for LibTimeZone b/c it is a manual OBJECT library instead of serenity_lib
install(TARGETS LibTimeZone EXPORT LagomTargets)
# LibIDL
# This is used by the BindingsGenerator so needs to always be built.
add_serenity_subdirectory(Userland/Libraries/LibIDL)
@ -401,6 +395,7 @@ set(lagom_standard_libraries
Syntax
TextCodec
Threading
TimeZone
TLS
Unicode
URL

View file

@ -4,15 +4,8 @@ set(SOURCES
${TIME_ZONE_DATA_SOURCES}
TimeZone.cpp
)
set(GENERATED_SOURCES ${CURRENT_LIB_GENERATED})
add_library(LibTimeZone OBJECT ${SOURCES})
serenity_generated_sources(LibTimeZone)
serenity_lib(LibTimeZone timezone)
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()