diff options
author | Viktor Szakats <commit@vsz.me> | 2022-10-11 07:52:32 +0000 |
---|---|---|
committer | Viktor Szakats <commit@vsz.me> | 2022-10-11 07:52:32 +0000 |
commit | 474a947e661abe1cdc752866e4f148c0db7ef571 (patch) | |
tree | b697417b49651c343f42da5bf42f2947256ebdb4 /CMake | |
parent | 23029838e277f6177b6ab99e9a78fa8dccddb1e4 (diff) | |
download | curl-474a947e661abe1cdc752866e4f148c0db7ef571.tar.gz |
cmake: enable more detection on Windows
Enable `HAVE_UNISTD_H`, `HAVE_STRTOK_R` and `HAVE_STRCASECMP` detection
on Windows, instead of having predefined values.
With these features detected correctly, CMake Windows builds get closer
to the autotools and `config-win32.h` ones.
This also fixes detecting `HAVE_FTRUNCATE` correctly, which required
`unistd.h`.
Fixing `ftruncate()` in turn causes a build warning/error with legacy
MinGW/MSYS1 due to an offset type size mismatch. This env misses to
detect `HAVE_FILE_OFFSET_BITS`, which may be a reason. This patch
force-disables `HAVE_FTRUNCATE` for this platform.
Reviewed-by: Daniel Stenberg
Closes #9687
Diffstat (limited to 'CMake')
-rw-r--r-- | CMake/Platforms/WindowsCache.cmake | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/CMake/Platforms/WindowsCache.cmake b/CMake/Platforms/WindowsCache.cmake index e056ad0d9..d6dc5a0fa 100644 --- a/CMake/Platforms/WindowsCache.cmake +++ b/CMake/Platforms/WindowsCache.cmake @@ -54,14 +54,11 @@ if(NOT UNIX) set(HAVE_TERMIOS_H 0) set(HAVE_TERMIO_H 0) set(HAVE_TIME_H 1) - set(HAVE_UNISTD_H 0) set(HAVE_UTIME_H 0) set(HAVE_SOCKET 1) set(HAVE_SELECT 1) set(HAVE_STRDUP 1) - set(HAVE_STRTOK_R 0) - set(HAVE_STRCASECMP 0) set(HAVE_STRICMP 1) set(HAVE_STRCMPI 1) set(HAVE_GETTIMEOFDAY 0) |