summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-06-27 07:34:43 +0200
committerPatrick Steinhardt <ps@pks.im>2019-07-11 08:28:55 +0200
commitdf54c7fb02b8bcdc6441f38dbf783cd344575f77 (patch)
treeee7a035e714e5f8087d49df28c8132a3f6c8bad0 /cmake
parent398412ccd3f982e2bc1de16d87bd00f27580c256 (diff)
downloadlibgit2-df54c7fb02b8bcdc6441f38dbf783cd344575f77.tar.gz
cmake: report whether we are using sub-second stat information
Depending on the platform and on build options, we may or may not build libgit2 with support for nanoseconds when using `stat` calls. It's currently unclear though whether sub-second stat information is used at all. Add feature info for this to tell at configure time whether it's being used or not.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindStatNsec.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/Modules/FindStatNsec.cmake b/cmake/Modules/FindStatNsec.cmake
index fa550a214..a4a09fa81 100644
--- a/cmake/Modules/FindStatNsec.cmake
+++ b/cmake/Modules/FindStatNsec.cmake
@@ -1,3 +1,5 @@
+INCLUDE(FeatureSummary)
+
CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtim "sys/types.h;sys/stat.h"
HAVE_STRUCT_STAT_ST_MTIM LANGUAGE C)
CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtimespec "sys/types.h;sys/stat.h"
@@ -17,4 +19,8 @@ ENDIF()
IF (HAVE_STRUCT_STAT_NSEC OR WIN32)
OPTION( USE_NSEC "Care about sub-second file mtimes and ctimes" ON )
+ELSE()
+ SET(USE_NSEC OFF)
ENDIF()
+
+ADD_FEATURE_INFO(nanoseconds USE_NSEC "whether to use sub-second file mtimes and ctimes")