From 3bcb7f0ed3b5e91f89a69c3c07842c91f2c802dc Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Fri, 16 Jun 2023 04:10:14 -0400 Subject: [PATCH] cmake: Reduce number of targets All of these files can be generated from one target --- src/tzdb/CMakeLists.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/tzdb/CMakeLists.txt b/src/tzdb/CMakeLists.txt index ca264d6..a3ac35e 100644 --- a/src/tzdb/CMakeLists.txt +++ b/src/tzdb/CMakeLists.txt @@ -34,7 +34,7 @@ execute_process( set(NX_VERSION_FILE ${NX_TZDB_DIR}/version.txt) file(WRITE ${NX_VERSION_FILE} "${TZDB_VERSION}") -add_custom_target(x80e +add_custom_target(x80e ALL DEPENDS tzdb2nx @@ -49,9 +49,11 @@ add_custom_command( WORKING_DIRECTORY ${NX_ZONEINFO_DIR}) -add_custom_target(binary_list +add_custom_target(time_zone_binary_list DEPENDS ${BINARY_LIST_TXT}) -add_dependencies(x80e binary_list) +add_dependencies(x80e time_zone_binary_list) + +set(TZ_DATA_LIST "") file(STRINGS "${TZIF_LIST_FILE}" TZ_FILES) foreach(FILE ${TZ_FILES}) @@ -69,9 +71,11 @@ foreach(FILE ${TZ_FILES}) DEPENDS tzdb2nx) - add_custom_target(${TARG_SANITIZED} - DEPENDS ${NX_TZ_TARGET}) - - add_dependencies(x80e ${TARG_SANITIZED}) - add_dependencies(binary_list ${TARG_SANITIZED}) + list(APPEND TZ_DATA_LIST ${NX_TZ_TARGET}) endforeach() + +add_custom_target(time_zone_data + DEPENDS ${TZ_DATA_LIST}) + +add_dependencies(x80e time_zone_data) +add_dependencies(time_zone_binary_list time_zone_data)