1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-08-19 09:42:06 +03:00
Files
libhttp/cmake/check/patch.cmake
Matt Clarkson b6c83a4ebe CMake Module to patch ithe check unit test library
There is an issue with the CMake build of check that produces a false
negative for clock_t, clockid_t and timer_t when using MinGW on Windows

This patches the project until the upstream patch is accepted:

     https://sourceforge.net/p/check/patches/53
2015-07-09 21:05:33 +02:00

13 lines
593 B
CMake

message(STATUS "Patching check ${VERSION} ${SOURCE_DIR}")
# Patch checks for MinGW
# https://sourceforge.net/p/check/patches/53/
set(CMAKE_LISTS_LOCATION "${SOURCE_DIR}/CMakeLists.txt")
file(READ ${CMAKE_LISTS_LOCATION} CMAKE_LISTS)
string(REGEX REPLACE
"(check_type_size\\((clock|clockid|timer)_t [A-Z_]+\\)[\r\n]+[^\r\n]+[\r\n]+[^\r\n]+[\r\n]+endif\\(NOT HAVE[A-Z_]+\\))"
"set(CMAKE_EXTRA_INCLUDE_FILES time.h)\n\\1\nunset(CMAKE_EXTRA_INCLUDE_FILES)"
CMAKE_LISTS "${CMAKE_LISTS}")
file(WRITE ${CMAKE_LISTS_LOCATION} "${CMAKE_LISTS}")
message(STATUS "Patched ${CMAKE_LISTS_LOCATION}")