summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2023-06-16 07:03:46 +0200
committerlat9nq <22451773+lat9nq@users.noreply.github.com>2023-06-16 11:17:03 +0200
commit7ffb96f474ec970823111d6274c495df95081a66 (patch)
tree774e3dc4e49466397fe6dda368f24ff980c2991c
parentcmake: Add option to always download time zone data (diff)
downloadyuzu-7ffb96f474ec970823111d6274c495df95081a66.tar
yuzu-7ffb96f474ec970823111d6274c495df95081a66.tar.gz
yuzu-7ffb96f474ec970823111d6274c495df95081a66.tar.bz2
yuzu-7ffb96f474ec970823111d6274c495df95081a66.tar.lz
yuzu-7ffb96f474ec970823111d6274c495df95081a66.tar.xz
yuzu-7ffb96f474ec970823111d6274c495df95081a66.tar.zst
yuzu-7ffb96f474ec970823111d6274c495df95081a66.zip
Diffstat (limited to '')
-rw-r--r--externals/nx_tzdb/CMakeLists.txt18
1 files changed, 13 insertions, 5 deletions
diff --git a/externals/nx_tzdb/CMakeLists.txt b/externals/nx_tzdb/CMakeLists.txt
index c15110fd6..67599faf4 100644
--- a/externals/nx_tzdb/CMakeLists.txt
+++ b/externals/nx_tzdb/CMakeLists.txt
@@ -12,27 +12,35 @@ find_program(GNU_DATE date)
set(CAN_BUILD_NX_TZDB true)
if ("${GIT}" STREQUAL "GIT-NOTFOUND")
- message("git program not found")
set(CAN_BUILD_NX_TZDB false)
endif()
if ("${GNU_MAKE}" STREQUAL "GNU_MAKE-NOTFOUND")
- message("GNU make program not found")
set(CAN_BUILD_NX_TZDB false)
endif()
if ("${GNU_DATE}" STREQUAL "GNU_DATE-NOTFOUND")
- message("GNU date program not found")
+ set(CAN_BUILD_NX_TZDB false)
+endif()
+if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
+ # tzdb_to_nx currently requires a posix-compliant host
set(CAN_BUILD_NX_TZDB false)
endif()
set(NX_TZDB_VERSION "220816")
set(NX_TZDB_ARCHIVE "${CMAKE_CURRENT_BINARY_DIR}/${NX_TZDB_VERSION}.zip")
+set(NX_TZDB_DIR "${CMAKE_CURRENT_BINARY_DIR}/nx_tzdb")
+
if ((NOT ${CAN_BUILD_NX_TZDB} OR ${YUZU_DOWNLOAD_TIME_ZONE_DATA}) AND NOT EXISTS ${NX_TZDB_ARCHIVE})
set(NX_TZDB_DOWNLOAD_URL "https://github.com/lat9nq/tzdb_to_nx/releases/download/${NX_TZDB_VERSION}/${NX_TZDB_VERSION}.zip")
- set(NX_TZDB_DIR "${CMAKE_CURRENT_BINARY_DIR}/nx_tzdb" CACHE PATH "Path to Switch-style time zone data")
+ message(STATUS "Downloading time zone data from ${NX_TZDB_DOWNLOAD_URL}...")
+ file(DOWNLOAD ${NX_TZDB_DOWNLOAD_URL} ${NX_TZDB_ARCHIVE}
+ STATUS NX_TZDB_DOWNLOAD_STATUS)
+ list(GET NX_TZDB_DOWNLOAD_STATUS 0 NX_TZDB_DOWNLOAD_STATUS_CODE)
+ if (NOT "${NX_TZDB_DOWNLOAD_STATUS_CODE}" STREQUAL "0")
+ message(FATAL_ERROR "Time zone data download failed (status code ${NX_TZDB_DOWNLOAD_STATUS_CODE})")
+ endif()
- file(DOWNLOAD ${NX_TZDB_DOWNLOAD_URL} ${NX_TZDB_ARCHIVE})
file(ARCHIVE_EXTRACT
INPUT
${NX_TZDB_ARCHIVE}