Skip to content

Commit

Permalink
cstest: use DOWNLOAD_EXTRACT_TIMESTAMP conditionally
Browse files Browse the repository at this point in the history
This feature was added in CMake 3.24.0, so this allows older CMakes to
still build the tests.
  • Loading branch information
hainest committed Dec 9, 2024
1 parent 0a29bf8 commit b1a7f25
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions suite/cstest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ find_library(libyaml
NAMES libyaml yaml
REQUIRED)
set(CMOCKA_LIB_FILE "${CMAKE_CURRENT_BINARY_DIR}/extern/src/cmocka_ext-build/src/libcmocka.a")

if(CMAKE_VERSION VERSION_GREATER "3.24.0")
set(DOWNLOAD_EXTRACT_TIMESTAMP "DOWNLOAD_EXTRACT_TIMESTAMP true")
endif()

ExternalProject_Add(cmocka_ext
PREFIX extern
URL "https://cmocka.org/files/1.1/cmocka-1.1.7.tar.xz"
URL_HASH SHA256=810570eb0b8d64804331f82b29ff47c790ce9cd6b163e98d47a4807047ecad82
DOWNLOAD_EXTRACT_TIMESTAMP true
${DOWNLOAD_EXTRACT_TIMESTAMP}
CONFIGURE_COMMAND cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ../cmocka_ext/
BUILD_COMMAND cmake --build . --config Release
BUILD_BYPRODUCTS "${CMOCKA_LIB_FILE}"
Expand All @@ -27,7 +32,7 @@ ExternalProject_Add(libcyaml_ext
PREFIX extern
URL "https://github.com/tlsa/libcyaml/archive/refs/tags/v1.4.2.tar.gz"
URL_HASH SHA256=3211b2a0589ebfe02c563c96adce9246c0787be2af30353becbbd362998d16dc
DOWNLOAD_EXTRACT_TIMESTAMP true
${DOWNLOAD_EXTRACT_TIMESTAMP}
CONFIGURE_COMMAND ""
BUILD_COMMAND make VARIANT=${LIBCYAML_VARIANT} PKG_CONFIG=pkg-config
BUILD_BYPRODUCTS "${LIBCYAML_LIB_FILE}"
Expand Down

0 comments on commit b1a7f25

Please sign in to comment.