summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2022-10-13 15:54:06 -0600
committerLinus Groh <mail@linusgroh.de>2022-10-16 16:36:39 +0200
commita01c0e81f32df9cdcc2a48ab77b2fdd191264b63 (patch)
tree0e17f280389fcab27e35997b3d548249b70fcf24
parentf7f92f104f7b403533756e3d4387b0e359a7de61 (diff)
downloadserenity-a01c0e81f32df9cdcc2a48ab77b2fdd191264b63.zip
Meta: Use add_serenity_directory for LibTimeZone
This lets us eliminate the "meta prefix" for the LibTimeZone generators.
-rw-r--r--Meta/CMake/time_zone_data.cmake22
-rw-r--r--Meta/Lagom/CMakeLists.txt10
2 files changed, 9 insertions, 23 deletions
diff --git a/Meta/CMake/time_zone_data.cmake b/Meta/CMake/time_zone_data.cmake
index 5e37f96e27..d95e32f760 100644
--- a/Meta/CMake/time_zone_data.cmake
+++ b/Meta/CMake/time_zone_data.cmake
@@ -68,30 +68,18 @@ if (ENABLE_TIME_ZONE_DATABASE_DOWNLOAD)
extract_tzdb_file("${TZDB_SOUTH_AMERICA_SOURCE}" "${TZDB_SOUTH_AMERICA_PATH}")
extract_tzdb_file("${TZDB_ZONE_1970_SOURCE}" "${TZDB_ZONE_1970_PATH}")
- set(TIME_ZONE_DATA_HEADER LibTimeZone/TimeZoneData.h)
- set(TIME_ZONE_DATA_IMPLEMENTATION LibTimeZone/TimeZoneData.cpp)
-
- set(TIME_ZONE_META_TARGET_PREFIX LibTimeZone_)
-
- if (CMAKE_CURRENT_BINARY_DIR MATCHES ".*/LibTimeZone") # Serenity build.
- set(TIME_ZONE_DATA_HEADER TimeZoneData.h)
- set(TIME_ZONE_DATA_IMPLEMENTATION TimeZoneData.cpp)
-
- set(TIME_ZONE_META_TARGET_PREFIX "")
- endif()
-
invoke_generator(
"TimeZoneData"
Lagom::GenerateTimeZoneData
"${TZDB_VERSION_FILE}"
- "${TIME_ZONE_META_TARGET_PREFIX}"
- "${TIME_ZONE_DATA_HEADER}"
- "${TIME_ZONE_DATA_IMPLEMENTATION}"
+ ""
+ "TimeZoneData.h"
+ "TimeZoneData.cpp"
arguments -z "${TZDB_ZONE_1970_PATH}" "${TZDB_AFRICA_PATH}" "${TZDB_ANTARCTICA_PATH}" "${TZDB_ASIA_PATH}" "${TZDB_AUSTRALASIA_PATH}" "${TZDB_BACKWARD_PATH}" "${TZDB_ETCETERA_PATH}" "${TZDB_EUROPE_PATH}" "${TZDB_NORTH_AMERICA_PATH}" "${TZDB_SOUTH_AMERICA_PATH}"
)
set(TIME_ZONE_DATA_SOURCES
- ${TIME_ZONE_DATA_HEADER}
- ${TIME_ZONE_DATA_IMPLEMENTATION}
+ "TimeZoneData.h"
+ "TimeZoneData.cpp"
)
endif()
diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt
index 1a80c58de4..c55e376ab6 100644
--- a/Meta/Lagom/CMakeLists.txt
+++ b/Meta/Lagom/CMakeLists.txt
@@ -143,6 +143,7 @@ include_directories(../../Userland/Services)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_BINARY_DIR}/Libraries)
+include_directories(${CMAKE_BINARY_DIR}/Userland/Libraries)
include_directories(${CMAKE_BINARY_DIR}/Services)
# install rules, think about moving to its own helper cmake file
@@ -298,12 +299,9 @@ add_serenity_subdirectory(Userland/Libraries/LibMain)
# LibTimeZone
# This is needed even if Lagom is not enabled because it is depended upon by code generators.
-include(time_zone_data)
-file(GLOB LIBTIMEZONE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibTimeZone/*.cpp")
-lagom_lib(TimeZone timezone
- SOURCES ${LIBTIMEZONE_SOURCES} ${TIME_ZONE_DATA_SOURCES}
-)
-target_compile_definitions(LibTimeZone PRIVATE ENABLE_TIME_ZONE_DATA=$<BOOL:${ENABLE_TIME_ZONE_DATABASE_DOWNLOAD}>)
+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.