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 /CMakeLists.txt | |
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 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d11fc593..156fe7903 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1293,6 +1293,8 @@ if(WIN32) if(NOT HAVE_MINGW_ORIGINAL) list(APPEND CURL_LIBS "bcrypt") + else() + set(HAVE_FTRUNCATE OFF) endif() endif() |