diff options
Diffstat (limited to 'src/civetweb/cmake/check')
-rw-r--r-- | src/civetweb/cmake/check/c82fe8888aacfe784476112edd3878256d2e30bc.patch | 31 | ||||
-rw-r--r-- | src/civetweb/cmake/check/patch.cmake | 12 |
2 files changed, 43 insertions, 0 deletions
diff --git a/src/civetweb/cmake/check/c82fe8888aacfe784476112edd3878256d2e30bc.patch b/src/civetweb/cmake/check/c82fe8888aacfe784476112edd3878256d2e30bc.patch new file mode 100644 index 000000000..e16ea1f5f --- /dev/null +++ b/src/civetweb/cmake/check/c82fe8888aacfe784476112edd3878256d2e30bc.patch @@ -0,0 +1,31 @@ +From c82fe8888aacfe784476112edd3878256d2e30bc Mon Sep 17 00:00:00 2001 +From: Joshua Boyd <jdboyd@Joshua-Boyds-Mac-mini.local> +Date: Wed, 23 Mar 2016 17:54:41 -0400 +Subject: [PATCH] Detect missing itimerspec on OSX. + +Set define to compiler accordingly. + +This fixes cmake on osx support. +--- + CMakeLists.txt | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e271e31..1d413e8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -193,6 +193,14 @@ if(NOT HAVE_SYS_TIME_H) + endif(MSVC) + endif(NOT HAVE_SYS_TIME_H) + ++# OSX has sys/time.h, but it still lacks itimerspec ++if(HAVE_SYS_TIME_H) ++ check_struct_member("struct itimerspec" it_value "sys/time.h" HAVE_STRUCT_ITIMERSPEC_IT_VALUE) ++ if(NOT HAVE_STRUCT_ITIMERSPEC_IT_VALUE) ++ add_definitions(-DSTRUCT_ITIMERSPEC_DEFINITION_MISSING=1) ++ set(STRUCT_ITIMERSPEC_DEFINITION_MISSING 1) ++ endif(NOT HAVE_STRUCT_ITIMERSPEC_IT_VALUE) ++endif(HAVE_SYS_TIME_H) + + ############################################################################### + # Check for integer types diff --git a/src/civetweb/cmake/check/patch.cmake b/src/civetweb/cmake/check/patch.cmake new file mode 100644 index 000000000..472d392b5 --- /dev/null +++ b/src/civetweb/cmake/check/patch.cmake @@ -0,0 +1,12 @@ +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}") |