diff options
author | Ozkan Sezer <sezeroz@gmail.com> | 2021-01-25 04:11:40 +0300 |
---|---|---|
committer | Ozkan Sezer <sezeroz@gmail.com> | 2021-01-25 04:11:40 +0300 |
commit | 233d2da098498dba7f4b8b8299d3f78841992311 (patch) | |
tree | ad0d47141201c90d83b07c0b41d43387324dbb4c /CMakeLists.txt | |
parent | d3680f26d5c2e05a243680a202d940ae9c14a57b (diff) | |
download | sdl-233d2da098498dba7f4b8b8299d3f78841992311.tar.gz |
better check for clock_gettime_nsec_np() -- cf. bug #5467.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6835785fd..39adf3168 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -873,7 +873,18 @@ if(LIBC) else() set(HAVE_ALLOCA_H 1) set(HAVE_ALLOCA 1) - check_symbol_exists(clock_gettime_nsec_np "time.h" HAVE_CLOCK_GETTIME_NSEC_NP) + if(IOS OR TVOS) # assuming iOS / TVOS >= 10.0 + set(HAVE_CLOCK_GETTIME_NSEC_NP 1) + else() + CHECK_C_SOURCE_COMPILES(" + #include <AvailabilityMacros.h> + #include <time.h> + #if MAC_OS_X_VERSION_MIN_REQUIRED < 101200 + #error Need 10.12 or newer target + #endif + int main(int argc, char **argv) { return !clock_gettime_nsec_np(CLOCK_MONOTONIC); } + " HAVE_CLOCK_GETTIME_NSEC_NP) + endif() endif() check_struct_has_member("struct sigaction" "sa_sigaction" "signal.h" HAVE_SA_SIGACTION) |