Skip to content

Commit 041a0ab

Browse files
committed
[c89stringutils_tests/test_c89stringutils/CMakeLists.txt] Skip hashing on SunOS
1 parent 8a30e3e commit 041a0ab

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

c89stringutils_tests/test_c89stringutils/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ string(REPLACE " " "_" EXEC_NAME "${EXEC_NAME}")
77

88
set(DOWNLOAD_DIR "${PROJECT_BINARY_DIR}/test_downloads")
99
file(MAKE_DIRECTORY "${DOWNLOAD_DIR}")
10+
11+
set(GREATEST_SHA256 "1292593d95c35eeccc89ffa1c91d6fe53b49f81cbf2c2b7758842b7f3186fcc2")
1012
file(DOWNLOAD "https://raw.githubusercontent.com/silentbicycle/greatest/11a6af1/greatest.h"
11-
"${DOWNLOAD_DIR}/greatest.h"
12-
EXPECTED_HASH "SHA256=1292593d95c35eeccc89ffa1c91d6fe53b49f81cbf2c2b7758842b7f3186fcc2")
13+
"${DOWNLOAD_DIR}/greatest.h")
14+
if (NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS")
15+
file(SHA256 "${DOWNLOAD_DIR}/greatest.h" GREATEST_SHA256_FOUND)
16+
if (NOT GREATEST_SHA256_FOUND STREQUAL GREATEST_SHA256)
17+
message(FATAL_ERROR "Hashes don't match on \"${DOWNLOAD_DIR}/greatest.h\" download")
18+
endif (NOT GREATEST_SHA256_FOUND STREQUAL GREATEST_SHA256)
19+
endif (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
1320

1421
#########
1522
# Tests #

0 commit comments

Comments
 (0)