diff options
author | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-06-16 10:00:19 +0200 |
---|---|---|
committer | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-06-16 10:00:19 +0200 |
commit | cdc73498e3863c1ac60dc08db24661be79b1b426 (patch) | |
tree | d57149b3b1e80f52ca2ce9f6cd0bcad5240605b1 /externals/nx_tzdb | |
parent | time_zone_manager: Compare to the correct boolean (diff) | |
download | yuzu-cdc73498e3863c1ac60dc08db24661be79b1b426.tar yuzu-cdc73498e3863c1ac60dc08db24661be79b1b426.tar.gz yuzu-cdc73498e3863c1ac60dc08db24661be79b1b426.tar.bz2 yuzu-cdc73498e3863c1ac60dc08db24661be79b1b426.tar.lz yuzu-cdc73498e3863c1ac60dc08db24661be79b1b426.tar.xz yuzu-cdc73498e3863c1ac60dc08db24661be79b1b426.tar.zst yuzu-cdc73498e3863c1ac60dc08db24661be79b1b426.zip |
Diffstat (limited to 'externals/nx_tzdb')
-rw-r--r-- | externals/nx_tzdb/CMakeLists.txt | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/externals/nx_tzdb/CMakeLists.txt b/externals/nx_tzdb/CMakeLists.txt index 119ffe8d6..d7e69a2ef 100644 --- a/externals/nx_tzdb/CMakeLists.txt +++ b/externals/nx_tzdb/CMakeLists.txt @@ -1,24 +1,47 @@ # SPDX-FileCopyrightText: 2023 yuzu Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later -set(NX_TZDB_VERSION "220816") -set(NX_TZDB_DOWNLOAD_URL "https://github.com/lat9nq/tzdb_to_nx/releases/download/${NX_TZDB_VERSION}/${NX_TZDB_VERSION}.zip") +set(NX_TZDB_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include") -set(NX_TZDB_ARCHIVE "${CMAKE_CURRENT_BINARY_DIR}/${NX_TZDB_VERSION}.zip") -set(NX_TZDB_DIR "${CMAKE_CURRENT_BINARY_DIR}/nx_tzdb") +add_library(nx_tzdb INTERFACE) -set(NX_TZDB_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include") +find_program(GIT git) +find_program(GNU_MAKE make) +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 (NOT ${CAN_BUILD_NX_TZDB} AND NOT EXISTS ${NX_TZDB_ARCHIVE}) + set(NX_TZDB_VERSION "220816") + set(NX_TZDB_DOWNLOAD_URL "https://github.com/lat9nq/tzdb_to_nx/releases/download/${NX_TZDB_VERSION}/${NX_TZDB_VERSION}.zip") + + set(NX_TZDB_ARCHIVE "${CMAKE_CURRENT_BINARY_DIR}/${NX_TZDB_VERSION}.zip") + set(NX_TZDB_DIR "${CMAKE_CURRENT_BINARY_DIR}/nx_tzdb" CACHE PATH "Path to Switch-style time zone data") -if (NOT EXISTS ${NX_TZDB_ARCHIVE}) file(DOWNLOAD ${NX_TZDB_DOWNLOAD_URL} ${NX_TZDB_ARCHIVE}) file(ARCHIVE_EXTRACT INPUT ${NX_TZDB_ARCHIVE} DESTINATION ${NX_TZDB_DIR}) +elseif (${CAN_BUILD_NX_TZDB}) + add_subdirectory(tzdb_to_nx) + add_dependencies(nx_tzdb x80e) endif() -add_library(nx_tzdb INTERFACE) target_include_directories(nx_tzdb INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include INTERFACE ${NX_TZDB_INCLUDE_DIR}) |