cmake: check for stat struct items correctly

This commit is contained in:
David Adam 2017-11-07 10:13:49 +08:00
parent 68da7ab822
commit a8938bcb4d

View file

@ -62,10 +62,12 @@ CHECK_FUNCTION_EXISTS(std::wcsncasecmp HAVE_STD__WCSNCASECMP)
CHECK_INCLUDE_FILE_CXX(strings.h HAVE_STRINGS_H) CHECK_INCLUDE_FILE_CXX(strings.h HAVE_STRINGS_H)
CHECK_INCLUDE_FILE_CXX(string.h HAVE_STRING_H) CHECK_INCLUDE_FILE_CXX(string.h HAVE_STRING_H)
CHECK_INCLUDE_FILE_CXX(stropts.h HAVE_STROPTS_H) CHECK_INCLUDE_FILE_CXX(stropts.h HAVE_STROPTS_H)
CHECK_FUNCTION_EXISTS(struct dirent HAVE_STRUCT_DIRENT_D_TYPE) CHECK_STRUCT_HAS_MEMBER("struct stat" st_ctime_nsec "sys/stat.h" HAVE_STRUCT_STAT_ST_CTIME_NSEC
CHECK_FUNCTION_EXISTS(struct stat HAVE_STRUCT_STAT_ST_CTIME_NSEC) LANGUAGE CXX)
CHECK_FUNCTION_EXISTS(struct stat HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC) CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtimespec.tv_nsec "sys/stat.h"
CHECK_FUNCTION_EXISTS(struct stat HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC) HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC LANGUAGE CXX)
CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtim.tv_nsec "sys/stat.h" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
LANGUAGE CXX)
CHECK_CXX_SYMBOL_EXISTS(sys_errlist stdio.h HAVE_SYS_ERRLIST) CHECK_CXX_SYMBOL_EXISTS(sys_errlist stdio.h HAVE_SYS_ERRLIST)
CHECK_INCLUDE_FILE_CXX(sys/ioctl.h HAVE_SYS_IOCTL_H) CHECK_INCLUDE_FILE_CXX(sys/ioctl.h HAVE_SYS_IOCTL_H)
CHECK_INCLUDE_FILE_CXX(sys/resource.h HAVE_SYS_RESOURCE_H) CHECK_INCLUDE_FILE_CXX(sys/resource.h HAVE_SYS_RESOURCE_H)