From 265fb0cdc72fc46347ae0b8964078ca6d0a978e1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 8 Oct 2015 13:26:44 -0400 Subject: [PATCH] cmFileTimeComparison: Update for lack of cmsys_STAT_HAS_ST_MTIM The KWSys Configure.hxx header no longer exposes this value. Take the value from the KWSys try compile result variable instead. --- Source/CMakeLists.txt | 12 ++++++++++++ Source/cmFileTimeComparison.cxx | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index ae5b03ff9..28a3fd143 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -548,6 +548,18 @@ foreach(v CURL_CA_BUNDLE CURL_CA_PATH) endif() endforeach() +foreach(check + STAT_HAS_ST_MTIM + ) + if(KWSYS_CXX_${check}_COMPILED) # abuse KWSys check cache entry + set(CMake_${check} 1) + else() + set(CMake_${check} 0) + endif() + set_property(SOURCE cmFileTimeComparison.cxx APPEND PROPERTY + COMPILE_DEFINITIONS CMake_${check}=${CMake_${check}}) +endforeach() + # create a library used by the command line and the GUI add_library(CMakeLib ${SRCS}) target_link_libraries(CMakeLib cmsys diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index 13e2a66e0..8d5e08daa 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -148,7 +148,7 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, cmFileTimeComparison_Type* s2) { #if !defined(_WIN32) || defined(__CYGWIN__) -# if cmsys_STAT_HAS_ST_MTIM +# if CMake_STAT_HAS_ST_MTIM // Compare using nanosecond resolution. if(s1->st_mtim.tv_sec < s2->st_mtim.tv_sec) { @@ -190,7 +190,7 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1, cmFileTimeComparison_Type* s2) { #if !defined(_WIN32) || defined(__CYGWIN__) -# if cmsys_STAT_HAS_ST_MTIM +# if CMake_STAT_HAS_ST_MTIM // Times are integers in units of 1ns. long long bil = 1000000000; long long t1 = s1->st_mtim.tv_sec * bil + s1->st_mtim.tv_nsec;