]> granicus.if.org Git - check/commitdiff
cmake: Include time.h on several checks to prevent false negatives
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sun, 14 Jun 2015 15:55:02 +0000 (15:55 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sun, 14 Jun 2015 15:55:02 +0000 (15:55 +0000)
The clock_t, clockid_t and timer_t types are deemed not found when they
are actually available if time.h is included. Include the header during
the checks.

Patch#53

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1204 64e312b2-a51f-0410-8e61-82d0ca0eb02a

AUTHORS
CMakeLists.txt
NEWS

diff --git a/AUTHORS b/AUTHORS
index 33447a6a8b5829dd0933b39a5fba30c8cf4fe954..08ac7d9b047c211be2123d47adc15ff757d86060 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -53,6 +53,7 @@ Contributors:
     Stewart Brodie        (bug fix: no fork mode failure reporting with teardowns)
     Michał Dębski         (Use mkstemp() if available instead of tmpfile() or tempnam())
     Sebastian Dröge       (Kill running tests if SIGTERM or SIGINT are caught in test runner)
+    Matt Clarkson         (Fix CMake checks using time.h for MinGW and MSVC)
 
 Anybody who has contributed code to Check or Check's build system is
 considered an author.  Send patches to this file to 
index 9aee07dfb5c9795962d335b9c1f105fb2d054081..46c48c75c02071b5e5da2d3b6c050e74c8740bbb 100644 (file)
@@ -217,15 +217,19 @@ check_type_size(uint64_t UINT64_T)
 check_type_size(uintmax_t UINTMAX_T)
 
 #
+set(CMAKE_EXTRA_INCLUDE_FILES time.h)
 check_type_size(clock_t CLOCK_T)
 if(NOT HAVE_CLOCK_T)
   set(clock_t int)
 endif(NOT HAVE_CLOCK_T)
+unset(CMAKE_EXTRA_INCLUDE_FILES)
 #
+set(CMAKE_EXTRA_INCLUDE_FILES time.h)
 check_type_size(clockid_t CLOCKID_T)
 if(NOT HAVE_CLOCKID_T)
   set(clockid_t int)
 endif(NOT HAVE_CLOCKID_T)
+unset(CMAKE_EXTRA_INCLUDE_FILES)
 #
 check_type_size(size_t SIZE_T)
 if(NOT HAVE_SIZE_T)
@@ -254,10 +258,12 @@ if(NOT HAVE_PID_T)
   endif(WIN32)
 endif(NOT HAVE_PID_T)
 #
+set(CMAKE_EXTRA_INCLUDE_FILES time.h)
 check_type_size(timer_t TIMER_T)
 if(NOT HAVE_TIMER_T)
   set(timer_t int)
 endif(NOT HAVE_TIMER_T)
+unset(CMAKE_EXTRA_INCLUDE_FILES)
 
 ###############################################################################
 # Check libraries
diff --git a/NEWS b/NEWS
index 15864b4d040619cfb27bf6543641c32d407c6a4d..8922db2c034d806c819f2515d0252f11d871fb09 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,10 @@
 In Development:
 # Mentioning Check 0.9.14 for now, to fix distcheck target until next release
 
+* CMake on MinGW and MSVC was unable to find time related types because
+  time.h was not included. This header is now included for the checks.
+  Patch #53.
+
 * If the test runner process catches a SIGTERM or SIGINT signal the running
   tests are now also killed.
   Patch #52.