Commit 3062a633 by Edward Thomson

cmake: extended futimens checking on macOS

parent e5975f36
...@@ -27,6 +27,7 @@ INCLUDE(AddCFlagIfSupported) ...@@ -27,6 +27,7 @@ INCLUDE(AddCFlagIfSupported)
INCLUDE(FindPkgLibraries) INCLUDE(FindPkgLibraries)
INCLUDE(FindThreads) INCLUDE(FindThreads)
INCLUDE(FindStatNsec) INCLUDE(FindStatNsec)
INCLUDE(Findfutimens)
INCLUDE(GNUInstallDirs) INCLUDE(GNUInstallDirs)
INCLUDE(IdeSplitSources) INCLUDE(IdeSplitSources)
INCLUDE(FeatureSummary) INCLUDE(FeatureSummary)
......
INCLUDE(EnableWarnings)
IF (APPLE)
# We cannot simply CHECK_FUNCTION_EXISTS on macOS because
# MACOSX_DEPLOYMENT_TARGET may be set to a version in the past
# that doesn't have futimens. Instead we need to enable warnings
# as errors, then check for the symbol existing in `sys/stat.h`,
# then reset warnings as errors.
ENABLE_WARNINGS(error)
CHECK_SYMBOL_EXISTS(futimens sys/stat.h HAVE_FUTIMENS)
DISABLE_WARNINGS(error)
ELSE ()
CHECK_FUNCTION_EXISTS(futimens HAVE_FUTIMENS)
ENDIF ()
...@@ -38,10 +38,10 @@ IF(ENABLE_TRACE) ...@@ -38,10 +38,10 @@ IF(ENABLE_TRACE)
ENDIF() ENDIF()
ADD_FEATURE_INFO(tracing GIT_TRACE "tracing support") ADD_FEATURE_INFO(tracing GIT_TRACE "tracing support")
CHECK_FUNCTION_EXISTS(futimens HAVE_FUTIMENS)
IF (HAVE_FUTIMENS) IF (HAVE_FUTIMENS)
SET(GIT_USE_FUTIMENS 1) SET(GIT_USE_FUTIMENS 1)
ENDIF () ENDIF ()
ADD_FEATURE_INFO(futimens GIT_USE_FUTIMENS "futimens support")
CHECK_PROTOTYPE_DEFINITION(qsort_r CHECK_PROTOTYPE_DEFINITION(qsort_r
"void qsort_r(void *base, size_t nmemb, size_t size, void *thunk, int (*compar)(void *, const void *, const void *))" "void qsort_r(void *base, size_t nmemb, size_t size, void *thunk, int (*compar)(void *, const void *, const void *))"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment