From be0dca8da3985e94308c0a5e2fa7d7695d5c62e7 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sun, 23 Jun 2024 16:51:58 -0400 Subject: [PATCH] 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. --- Meta/Lagom/CMakeLists.txt | 7 +------ Userland/Libraries/LibTimeZone/CMakeLists.txt | 11 ++--------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt index 2fdc738dcea..b4fa5b25aa3 100644 --- a/Meta/Lagom/CMakeLists.txt +++ b/Meta/Lagom/CMakeLists.txt @@ -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 diff --git a/Userland/Libraries/LibTimeZone/CMakeLists.txt b/Userland/Libraries/LibTimeZone/CMakeLists.txt index c1cf99953ba..19eb30bc133 100644 --- a/Userland/Libraries/LibTimeZone/CMakeLists.txt +++ b/Userland/Libraries/LibTimeZone/CMakeLists.txt @@ -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=$) - -# 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()