aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorthe-black-eagle <g.moore@gmx.co.uk>2020-06-20 09:13:26 +0100
committerthe-black-eagle <g.moore@gmx.co.uk>2020-08-03 22:58:33 +0100
commitc4ff4c40fe0b1605055804fd88dbf89eee0eb37b (patch)
tree3bf77a0095bde690ab9bb96c0846df1044bbcb51 /cmake
parentca8b8a0030a4d28a736823b0df1d5aff2c2a6a3d (diff)
[filesystem] Use statx on posix systems if available to get file birth time
Diffstat (limited to 'cmake')
-rw-r--r--cmake/scripts/common/ArchSetup.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/cmake/scripts/common/ArchSetup.cmake b/cmake/scripts/common/ArchSetup.cmake
index 2e1eb128ad..1f8b10d501 100644
--- a/cmake/scripts/common/ArchSetup.cmake
+++ b/cmake/scripts/common/ArchSetup.cmake
@@ -108,6 +108,21 @@ if(HAVE_INTTYPES_H)
list(APPEND SYSTEM_DEFINES -DHAVE_INTTYPES_H=1)
endif()
+set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
+check_symbol_exists("STATX_BTIME" "linux/stat.h" HAVE_STATX)
+if(HAVE_STATX)
+ check_function_exists("statx" FOUND_STATX_FUNCTION)
+ if(FOUND_STATX_FUNCTION)
+ message(STATUS "statx is available")
+ list(APPEND ARCH_DEFINES "-DHAVE_STATX=1")
+ else()
+ message(STATUS "statx flags found but no linkable function : C library too old ?")
+ endif()
+else()
+ message(STATUS "statx() not found")
+endif()
+set(CMAKE_REQUIRED_DEFINITIONS "")
+
find_package(SSE)
foreach(_sse SSE SSE2 SSE3 SSSE3 SSE4_1 SSE4_2 AVX AVX2)
if(${${_sse}_FOUND})