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.
This commit is contained in:
Brad King 2015-10-08 13:26:44 -04:00
parent 8083285d1b
commit 265fb0cdc7
2 changed files with 14 additions and 2 deletions

View File

@ -548,6 +548,18 @@ foreach(v CURL_CA_BUNDLE CURL_CA_PATH)
endif() endif()
endforeach() 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 # create a library used by the command line and the GUI
add_library(CMakeLib ${SRCS}) add_library(CMakeLib ${SRCS})
target_link_libraries(CMakeLib cmsys target_link_libraries(CMakeLib cmsys

View File

@ -148,7 +148,7 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
cmFileTimeComparison_Type* s2) cmFileTimeComparison_Type* s2)
{ {
#if !defined(_WIN32) || defined(__CYGWIN__) #if !defined(_WIN32) || defined(__CYGWIN__)
# if cmsys_STAT_HAS_ST_MTIM # if CMake_STAT_HAS_ST_MTIM
// Compare using nanosecond resolution. // Compare using nanosecond resolution.
if(s1->st_mtim.tv_sec < s2->st_mtim.tv_sec) if(s1->st_mtim.tv_sec < s2->st_mtim.tv_sec)
{ {
@ -190,7 +190,7 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1,
cmFileTimeComparison_Type* s2) cmFileTimeComparison_Type* s2)
{ {
#if !defined(_WIN32) || defined(__CYGWIN__) #if !defined(_WIN32) || defined(__CYGWIN__)
# if cmsys_STAT_HAS_ST_MTIM # if CMake_STAT_HAS_ST_MTIM
// Times are integers in units of 1ns. // Times are integers in units of 1ns.
long long bil = 1000000000; long long bil = 1000000000;
long long t1 = s1->st_mtim.tv_sec * bil + s1->st_mtim.tv_nsec; long long t1 = s1->st_mtim.tv_sec * bil + s1->st_mtim.tv_nsec;