]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: pre-cache `HAVE_BASENAME` for mingw-w64 and MSVC
authorViktor Szakats <commit@vsz.me>
Thu, 28 Sep 2023 11:50:43 +0000 (11:50 +0000)
committerViktor Szakats <commit@vsz.me>
Thu, 28 Sep 2023 21:33:55 +0000 (21:33 +0000)
`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

index 77c27c124e06f37e34ea9c7da3bd847e5ac7687a..a616bf0c110a961ba93f780571df290168314c1c 100644 (file)
@@ -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)