From: Viktor Szakats Date: Thu, 16 Jan 2025 14:21:23 +0000 (+0100) Subject: cmake: pre-fill `HAVE_STDATOMIC_H`, `HAVE_ATOMIC` for mingw-w64 X-Git-Tag: curl-8_12_0~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5fb2b29d58efa683ed080c3790712ea7af8eeb6;p=thirdparty%2Fcurl.git cmake: pre-fill `HAVE_STDATOMIC_H`, `HAVE_ATOMIC` for mingw-w64 `stdatomic.h` and `_Atomic` were first available in gcc 4.9.0 and llvm/clang 3.6. Set detection values accordingly and save these two detections on configure runs. Closes #16036 --- diff --git a/CMake/win32-cache.cmake b/CMake/win32-cache.cmake index cb55b74774..25323fddfc 100644 --- a/CMake/win32-cache.cmake +++ b/CMake/win32-cache.cmake @@ -45,6 +45,14 @@ if(MINGW) set(HAVE_UTIME_H 1) # wrapper to sys/utime.h set(HAVE_DIRENT_H 1) set(HAVE_OPENDIR 1) + if((CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) OR + (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6)) + set(HAVE_STDATOMIC_H 1) + set(HAVE_ATOMIC 1) + else() + set(HAVE_STDATOMIC_H 0) + set(HAVE_ATOMIC 0) + endif() else() set(HAVE_LIBGEN_H 0) set(HAVE_FTRUNCATE 0)