Skip to content

Commit 976357e

Browse files
authored
fix: gate json fetch timestamp option (#449)
1 parent 4736992 commit 976357e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

server/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1919
find_package(nlohmann_json CONFIG QUIET)
2020
if(NOT nlohmann_json_FOUND)
2121
include(FetchContent)
22-
FetchContent_Declare(json
22+
set(_dflash_json_fetch_args
2323
URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz
24-
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
2524
URL_HASH SHA256=d6c65aca6b1ed68e7a182f4757257b107ae403032760ed6ef121c9d55e81757d
2625
)
26+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24")
27+
list(APPEND _dflash_json_fetch_args DOWNLOAD_EXTRACT_TIMESTAMP TRUE)
28+
endif()
29+
FetchContent_Declare(json ${_dflash_json_fetch_args})
30+
unset(_dflash_json_fetch_args)
2731
FetchContent_MakeAvailable(json)
2832
endif()
2933

0 commit comments

Comments
 (0)