From 14b745608b96a73b4afa5794519727c34485e965 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 28 Sep 2023 11:50:43 +0000 Subject: [PATCH] cmake: pre-cache `HAVE_BASENAME` for mingw-w64 and MSVC `basename` is present in mingw-w64, missing from MSVC. Pre-cache accordingly to make configure faster. Notice that `basename` has a bug so we later disable it even with mingw-w64: https://github.com/curl/curl/blob/781242ffa44a9f9b95b6da5ac5a1bf6372ec6257/lib/curl_setup.h#L820-L825 Closes #11974 --- CMake/Platforms/WindowsCache.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMake/Platforms/WindowsCache.cmake b/CMake/Platforms/WindowsCache.cmake index 77c27c124e..a616bf0c11 100644 --- a/CMake/Platforms/WindowsCache.cmake +++ b/CMake/Platforms/WindowsCache.cmake @@ -33,6 +33,7 @@ if(NOT UNIX) set(HAVE_UNISTD_H 1) set(HAVE_INTTYPES_H 1) set(HAVE_STRTOLL 1) + set(HAVE_BASENAME 1) elseif(MSVC) if(NOT MSVC_VERSION LESS 1800) set(HAVE_INTTYPES_H 1) @@ -46,6 +47,7 @@ if(NOT UNIX) else() set(HAVE_SNPRINTF 0) endif() + set(HAVE_BASENAME 0) endif() set(HAVE_LIBSOCKET 0)