summaryrefslogtreecommitdiff
path: root/cmake/FindStatNsec.cmake
blob: 9dfdf51c4e7886546fd7047129943e77a8cf49e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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"
	HAVE_STRUCT_STAT_ST_MTIMESPEC LANGUAGE C)
check_struct_has_member("struct stat" st_mtime_nsec sys/stat.h
	HAVE_STRUCT_STAT_MTIME_NSEC LANGUAGE C)

if(HAVE_STRUCT_STAT_ST_MTIM)
	check_struct_has_member("struct stat" st_mtim.tv_nsec sys/stat.h
		HAVE_STRUCT_STAT_NSEC LANGUAGE C)
elseif(HAVE_STRUCT_STAT_ST_MTIMESPEC)
	check_struct_has_member("struct stat" st_mtimespec.tv_nsec sys/stat.h
		HAVE_STRUCT_STAT_NSEC LANGUAGE C)
else()
	set(HAVE_STRUCT_STAT_NSEC ON )
endif()

add_feature_info(nanoseconds USE_NSEC "support nanosecond precision file mtimes and ctimes")