]> git.proxmox.com Git - libgit2.git/blob - cmake/FindStatNsec.cmake
Apply M-A hint to libgit2-fixtures
[libgit2.git] / cmake / FindStatNsec.cmake
1 include(FeatureSummary)
2
3 check_struct_has_member("struct stat" st_mtim "sys/types.h;sys/stat.h"
4 HAVE_STRUCT_STAT_ST_MTIM LANGUAGE C)
5 check_struct_has_member("struct stat" st_mtimespec "sys/types.h;sys/stat.h"
6 HAVE_STRUCT_STAT_ST_MTIMESPEC LANGUAGE C)
7 check_struct_has_member("struct stat" st_mtime_nsec sys/stat.h
8 HAVE_STRUCT_STAT_MTIME_NSEC LANGUAGE C)
9
10 if(HAVE_STRUCT_STAT_ST_MTIM)
11 check_struct_has_member("struct stat" st_mtim.tv_nsec sys/stat.h
12 HAVE_STRUCT_STAT_NSEC LANGUAGE C)
13 elseif(HAVE_STRUCT_STAT_ST_MTIMESPEC)
14 check_struct_has_member("struct stat" st_mtimespec.tv_nsec sys/stat.h
15 HAVE_STRUCT_STAT_NSEC LANGUAGE C)
16 else()
17 set(HAVE_STRUCT_STAT_NSEC ON )
18 endif()
19
20 add_feature_info(nanoseconds USE_NSEC "support nanosecond precision file mtimes and ctimes")