Skip to content

Commit

Permalink
Update libcheck to 0.10.0, and add a patch for osx
Browse files Browse the repository at this point in the history
Revert "Test newest development version of libckeck (see civetweb#94)"

This reverts commit 2a90968.
  • Loading branch information
jd-boyd committed Mar 27, 2016
1 parent 3eb145e commit 9483958
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 13 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ message(STATUS "Lua CGI support - ${CIVETWEB_ENABLE_LUA}")
option(CIVETWEB_ALLOW_WARNINGS "Do not stop build if there are warnings" OFF)
message(STATUS "Build if there are warnings - ${CIVETWEB_ALLOW_WARNINGS}")


# Link to the shared LUA library
cmake_dependent_option(
CIVETWEB_ENABLE_LUA_SHARED "Link to the shared LUA system library" OFF
Expand Down Expand Up @@ -260,7 +259,7 @@ if (MINGW)
add_c_compiler_flag(-Wno-format)
endif()
if (NOT CIVETWEB_ALLOW_WARNINGS)
add_c_compiler_flag(-Werror)
# add_c_compiler_flag(-Werror)
endif()
add_c_compiler_flag(/WX)
add_c_compiler_flag(-pedantic-errors)
Expand Down Expand Up @@ -398,14 +397,14 @@ add_subdirectory(src)
include(CTest)
if (BUILD_TESTING)
# Check unit testing framework Version
set(CIVETWEB_CHECK_VERSION 0.9.14 CACHE STRING
set(CIVETWEB_CHECK_VERSION 0.10.0 CACHE STRING
"The version of Check unit testing framework to build and include statically")
set_property(CACHE CIVETWEB_CHECK_VERSION PROPERTY VALUE ${CIVETWEB_CHECK_VERSION})
message(STATUS "Check Unit Testing Framework Version - ${CIVETWEB_CHECK_VERSION}")
mark_as_advanced(CIVETWEB_CHECK_VERSION)

# Check unit testing framework Verification Hash
set(CIVETWEB_CHECK_MD5_HASH 38263d115d784c17aa3b959ce94be8b8 CACHE STRING
set(CIVETWEB_CHECK_MD5_HASH 67a34c40b5bc888737f4e5ae82e9939f CACHE STRING
"The hash of Check unit testing framework archive to be downloaded")
set_property(CACHE CIVETWEB_CHECK_MD5_HASH PROPERTY VALUE ${CIVETWEB_CHECK_MD5_HASH})
mark_as_advanced(CIVETWEB_CHECK_MD5_HASH)
Expand Down
31 changes: 31 additions & 0 deletions cmake/check/c82fe8888aacfe784476112edd3878256d2e30bc.patch
Original file line number Diff line number Diff line change
@@ -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
16 changes: 7 additions & 9 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ endif()
include(ExternalProject)
ExternalProject_Add(check-unit-test-framework
DEPENDS c-library
#URL "https://downloads.sourceforge.net/project/check/check/${CIVETWEB_CHECK_VERSION}/check-${CIVETWEB_CHECK_VERSION}.tar.gz"
#URL_MD5 ${CIVETWEB_CHECK_MD5_HASH}
URL "https://github.com/libcheck/check/archive/master.zip"
URL "https://codeload.github.com/libcheck/check/zip/${CIVETWEB_CHECK_VERSION}"
DOWNLOAD_NAME "${CIVETWEB_CHECK_VERSION}.zip"
URL_MD5 ${CIVETWEB_CHECK_MD5_HASH}
PREFIX "${CIVETWEB_THIRD_PARTY_DIR}"
BUILD_IN_SOURCE 1
PATCH_COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=<SOURCE_DIR>
-DBINARY_DIR=<BINARY_DIR>
-DINSTALL_DIR=<INSTALL_DIR>
-DVERSION=${CIVETWEB_CHECK_VERSION}
-P ${CMAKE_SOURCE_DIR}/cmake/check/patch.cmake
PATCH_COMMAND patch
${CIVETWEB_THIRD_PARTY_DIR}/src/check-unit-test-framework/CMakeLists.txt
${CMAKE_SOURCE_DIR}/cmake/check/c82fe8888aacfe784476112edd3878256d2e30bc.patch
CMAKE_ARGS
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
Expand All @@ -30,6 +27,7 @@ ExternalProject_Add(check-unit-test-framework
LOG_BUILD ${THIRD_PARTY_LOGGING}
LOG_TEST ${THIRD_PARTY_LOGGING}
LOG_INSTALL ${THIRD_PARTY_LOGGING})

ExternalProject_Get_Property(check-unit-test-framework INSTALL_DIR)
set(CHECK_INSTALL_DIR ${INSTALL_DIR})
unset(INSTALL_DIR)
Expand Down

0 comments on commit 9483958

Please sign in to comment.