Skip to content

Commit df54c7f

Browse files
committed
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.
1 parent 398412c commit df54c7f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmake/Modules/FindStatNsec.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
INCLUDE(FeatureSummary)
2+
13
CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtim "sys/types.h;sys/stat.h"
24
HAVE_STRUCT_STAT_ST_MTIM LANGUAGE C)
35
CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtimespec "sys/types.h;sys/stat.h"
@@ -17,4 +19,8 @@ ENDIF()
1719

1820
IF (HAVE_STRUCT_STAT_NSEC OR WIN32)
1921
OPTION( USE_NSEC "Care about sub-second file mtimes and ctimes" ON )
22+
ELSE()
23+
SET(USE_NSEC OFF)
2024
ENDIF()
25+
26+
ADD_FEATURE_INFO(nanoseconds USE_NSEC "whether to use sub-second file mtimes and ctimes")

0 commit comments

Comments
 (0)