mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 11:55:08 +00:00

We have logic for serenity_generated_sources which works well for source files that are specified in GENERATED_SOURCES prior to calling serenity_lib or serenity_bin. However, code generated with invoke_generator, and the LibWeb generators do not always follow the pattern of the IDL and GML files. For the LibWeb generators, we can just add_dependencies to LibWeb at the time we declare the generate_Foo custom target. However for LibLocale, LibTimeZone, and LibUnicode, we don't have the name of the target available, so export the name in a variable to set into GENERATED_SOURCES. To make this work for Lagom, we need to make sure that lagom_lib and serenity_bin in Lagom/CMakeLists.txt call serenity_generated_sources on the target. This enables the Xcode generator on macOS hosts, at least for Lagom.
15 lines
636 B
CMake
15 lines
636 B
CMake
include(${SerenityOS_SOURCE_DIR}/Meta/CMake/time_zone_data.cmake)
|
|
|
|
set(SOURCES
|
|
TimeZone.cpp
|
|
${TIME_ZONE_DATA_SOURCES}
|
|
)
|
|
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)
|