[Cmake-commits] CMake branch, next, updated. v3.4.0-rc1-214-g2aa7685
Brad King
brad.king at kitware.com
Thu Oct 8 13:35:57 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 2aa7685256dfa5063641eb125a56b557d9621369 (commit)
via 0faccb839a75ab94f1ab39681a1ebe567647be6b (commit)
via 265fb0cdc72fc46347ae0b8964078ca6d0a978e1 (commit)
via 8083285d1bd5ecc31afa5fa689a9a4ca13ca8bb9 (commit)
via 13c22d280e3b4d4f73e607617d18a3d55b509099 (commit)
from a1fc051fa7eabeca93163887cbe0039dc2b78310 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2aa7685256dfa5063641eb125a56b557d9621369
commit 2aa7685256dfa5063641eb125a56b557d9621369
Merge: a1fc051 0faccb8
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 8 13:35:56 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Oct 8 13:35:56 2015 -0400
Merge topic 'update-kwsys' into next
0faccb83 bootstrap: Drop unnecessary KWSys platform check
265fb0cd cmFileTimeComparison: Update for lack of cmsys_STAT_HAS_ST_MTIM
8083285d Merge branch 'upstream-kwsys' into update-kwsys
13c22d28 KWSys 2015-10-06 (ed82989c)
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0faccb839a75ab94f1ab39681a1ebe567647be6b
commit 0faccb839a75ab94f1ab39681a1ebe567647be6b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 8 13:27:07 2015 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 8 13:27:07 2015 -0400
bootstrap: Drop unnecessary KWSys platform check
The KWSys Configure.hxx header no longer needs KWSYS_STAT_HAS_ST_MTIM.
Our bootstrap-built CMake does not need to handle nanosecond precision
file times anyway.
diff --git a/bootstrap b/bootstrap
index ca4fd5e..ca86528 100755
--- a/bootstrap
+++ b/bootstrap
@@ -493,7 +493,7 @@ cmake_kwsys_config_replace_string ()
s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
s/@KWSYS_STL_HAS_WSTRING@/${KWSYS_STL_HAS_WSTRING}/g;
- s/@KWSYS_STAT_HAS_ST_MTIM@/${KWSYS_STAT_HAS_ST_MTIM}/g;}" >> "${OUTFILE}${_tmp}"
+ }" >> "${OUTFILE}${_tmp}"
if [ -f "${OUTFILE}${_tmp}" ]; then
if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
#echo "Files are the same"
@@ -1173,7 +1173,6 @@ KWSYS_NAME_IS_KWSYS=0
KWSYS_BUILD_SHARED=0
KWSYS_LFS_AVAILABLE=0
KWSYS_LFS_REQUESTED=0
-KWSYS_STAT_HAS_ST_MTIM=0
KWSYS_STL_HAS_WSTRING=0
KWSYS_CXX_HAS_SETENV=0
KWSYS_CXX_HAS_UNSETENV=0
@@ -1217,15 +1216,6 @@ else
echo "${cmake_cxx_compiler} does not have stl wstring"
fi
-if cmake_try_run "${cmake_cxx_compiler}" \
- "${cmake_cxx_flags} -DTEST_KWSYS_STAT_HAS_ST_MTIM" \
- "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
- KWSYS_STAT_HAS_ST_MTIM=1
- echo "${cmake_cxx_compiler} has struct stat with st_mtim member"
-else
- echo "${cmake_cxx_compiler} does not have struct stat with st_mtim member"
-fi
-
# Just to be safe, let us store compiler and flags to the header file
cmake_bootstrap_version='$Revision$'
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=265fb0cdc72fc46347ae0b8964078ca6d0a978e1
commit 265fb0cdc72fc46347ae0b8964078ca6d0a978e1
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 8 13:26:44 2015 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 8 13:26:44 2015 -0400
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.
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index ae5b03f..28a3fd1 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 13e2a66..8d5e08d 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;
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8083285d1bd5ecc31afa5fa689a9a4ca13ca8bb9
commit 8083285d1bd5ecc31afa5fa689a9a4ca13ca8bb9
Merge: 750391a 13c22d2
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 8 13:26:08 2015 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 8 13:26:08 2015 -0400
Merge branch 'upstream-kwsys' into update-kwsys
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=13c22d280e3b4d4f73e607617d18a3d55b509099
commit 13c22d280e3b4d4f73e607617d18a3d55b509099
Author: KWSys Robot <kwrobot at kitware.com>
AuthorDate: Tue Oct 6 10:29:47 2015 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 8 13:26:04 2015 -0400
KWSys 2015-10-06 (ed82989c)
Extract upstream KWSys using the following shell commands.
$ git archive --prefix=upstream-kwsys/ ed82989c | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' d79801bb..ed82989c
Brad King (3):
9baab632 SystemTools: Keep stat st_mtim field existence private
39475e20 SystemTools: Refactor utimes invocation
ed82989c SystemTools: Implement nanosecond file times on OS X
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 84010d8..ce7f563 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -342,11 +342,6 @@ ENDIF()
# capabilities and parent project's request. Enforce 0/1 as only
# possible values for configuration into Configure.hxx.
-IF(UNIX)
- KWSYS_PLATFORM_CXX_TEST(KWSYS_STAT_HAS_ST_MTIM
- "Checking whether struct stat has st_mtim member" DIRECT)
-ENDIF()
-
# Check existence and uniqueness of long long and __int64.
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_LONG_LONG
"Checking whether C++ compiler has 'long long'" DIRECT)
@@ -511,12 +506,18 @@ IF(KWSYS_USE_SystemTools)
"Checking whether CXX compiler has utimes" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMENSAT
"Checking whether CXX compiler has utimensat" DIRECT)
+ KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_STAT_HAS_ST_MTIM
+ "Checking whether CXX compiler struct stat has st_mtim member" DIRECT)
+ KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
+ "Checking whether CXX compiler struct stat has st_mtimespec member" DIRECT)
SET_PROPERTY(SOURCE SystemTools.cxx APPEND PROPERTY COMPILE_DEFINITIONS
KWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV}
KWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV}
KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}
KWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES}
KWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT}
+ KWSYS_CXX_STAT_HAS_ST_MTIM=${KWSYS_CXX_STAT_HAS_ST_MTIM}
+ KWSYS_CXX_STAT_HAS_ST_MTIMESPEC=${KWSYS_CXX_STAT_HAS_ST_MTIMESPEC}
)
ENDIF()
diff --git a/Configure.hxx.in b/Configure.hxx.in
index 3faf862..ff8e49d 100644
--- a/Configure.hxx.in
+++ b/Configure.hxx.in
@@ -18,9 +18,6 @@
/* Whether wstring is available. */
#define @KWSYS_NAMESPACE at _STL_HAS_WSTRING @KWSYS_STL_HAS_WSTRING@
-/* Whether struct stat has the st_mtim member for high resolution times. */
-#define @KWSYS_NAMESPACE at _STAT_HAS_ST_MTIM @KWSYS_STAT_HAS_ST_MTIM@
-
/* If building a C++ file in kwsys itself, give the source file
access to the macros without a configured namespace. */
#if defined(KWSYS_NAMESPACE)
@@ -28,7 +25,6 @@
# define kwsys @KWSYS_NAMESPACE@
# endif
# define KWSYS_NAME_IS_KWSYS @KWSYS_NAMESPACE at _NAME_IS_KWSYS
-# define KWSYS_STAT_HAS_ST_MTIM @KWSYS_NAMESPACE at _STAT_HAS_ST_MTIM
# define KWSYS_STL_HAS_WSTRING @KWSYS_NAMESPACE at _STL_HAS_WSTRING
#endif
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 262af27..da34eb9 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -1366,15 +1366,18 @@ bool SystemTools::Touch(const std::string& filename, bool create)
struct timeval mtime;
gettimeofday(&mtime, 0);
# if KWSYS_CXX_HAS_UTIMES
- struct timeval times[2] =
- {
-# if KWSYS_STAT_HAS_ST_MTIM
- {st.st_atim.tv_sec, st.st_atim.tv_nsec/1000}, /* tv_sec, tv_usec */
+ struct timeval atime;
+# if KWSYS_CXX_STAT_HAS_ST_MTIM
+ atime.tv_sec = st.st_atim.tv_sec;
+ atime.tv_usec = st.st_atim.tv_nsec/1000;
+# elif KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
+ atime.tv_sec = st.st_atimespec.tv_sec;
+ atime.tv_usec = st.st_atimespec.tv_nsec/1000;
# else
- {st.st_atime, 0},
+ atime.tv_sec = st.st_atime;
+ atime.tv_usec = 0;
# endif
- mtime
- };
+ struct timeval times[2] = { atime, mtime };
if(utimes(filename.c_str(), times) < 0)
{
return false;
@@ -1408,7 +1411,7 @@ bool SystemTools::FileTimeCompare(const std::string& f1,
{
return false;
}
-# if KWSYS_STAT_HAS_ST_MTIM
+# if KWSYS_CXX_STAT_HAS_ST_MTIM
// Compare using nanosecond resolution.
if(s1.st_mtim.tv_sec < s2.st_mtim.tv_sec)
{
@@ -1426,6 +1429,24 @@ bool SystemTools::FileTimeCompare(const std::string& f1,
{
*result = 1;
}
+# elif KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
+ // Compare using nanosecond resolution.
+ if(s1.st_mtimespec.tv_sec < s2.st_mtimespec.tv_sec)
+ {
+ *result = -1;
+ }
+ else if(s1.st_mtimespec.tv_sec > s2.st_mtimespec.tv_sec)
+ {
+ *result = 1;
+ }
+ else if(s1.st_mtimespec.tv_nsec < s2.st_mtimespec.tv_nsec)
+ {
+ *result = -1;
+ }
+ else if(s1.st_mtimespec.tv_nsec > s2.st_mtimespec.tv_nsec)
+ {
+ *result = 1;
+ }
# else
// Compare using 1 second resolution.
if(s1.st_mtime < s2.st_mtime)
diff --git a/kwsysPlatformTestsCXX.cxx b/kwsysPlatformTestsCXX.cxx
index 94579b3..9626937 100644
--- a/kwsysPlatformTestsCXX.cxx
+++ b/kwsysPlatformTestsCXX.cxx
@@ -32,7 +32,7 @@ int main()
}
#endif
-#ifdef TEST_KWSYS_STAT_HAS_ST_MTIM
+#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -45,6 +45,19 @@ int main()
}
#endif
+#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+int main()
+{
+ struct stat stat1;
+ (void)stat1.st_mtimespec.tv_sec;
+ (void)stat1.st_mtimespec.tv_nsec;
+ return 0;
+}
+#endif
+
#ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64
void function(long**) {}
int main()
-----------------------------------------------------------------------
Summary of changes:
Source/CMakeLists.txt | 12 +++++++++++
Source/cmFileTimeComparison.cxx | 4 ++--
Source/kwsys/CMakeLists.txt | 11 +++++-----
Source/kwsys/Configure.hxx.in | 4 ----
Source/kwsys/SystemTools.cxx | 37 +++++++++++++++++++++++++-------
Source/kwsys/kwsysPlatformTestsCXX.cxx | 15 ++++++++++++-
bootstrap | 12 +----------
7 files changed, 64 insertions(+), 31 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list