Hash :
9324d16e
Author :
Date :
2021-11-06T16:14:47
cmake: standardize USE_THREADS and USE_NSEC Threading can now be disabled with `USE_THREADS=OFF` instead of `THREADSAFE=OFF` to better support the other cmake semantics. Nanosecond support is the default _if_ we can detect it. This should be our default always - like threads - and people can opt out explicitly.
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")