summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorLi Xinwei <1326710505@qq.com>2021-06-04 15:03:30 +0800
committerDaniel Stenberg <daniel@haxx.se>2021-06-21 14:52:27 +0200
commit30e491e5c921aecca5a16083d8185840dc64eccd (patch)
tree66cb4ebe7d4e68a4fdafe17e713e25236d288d2c /CMakeLists.txt
parent62be0960858f18798f5f2bf662cbfd9ae3948eb4 (diff)
downloadcurl-30e491e5c921aecca5a16083d8185840dc64eccd.tar.gz
cmake: fix support for UnixSockets feature on Win32
Move the definition of sockaddr_un struct from config-win32.h to curl_setup.h, so that it could be shared by all build systems. Add ADDRESS_FAMILY typedef for old mingw, now old mingw can also use unix sockets. Also fix the build of tests/server/sws.c on Win32 when USE_UNIX_SOCKETS is defined. Closes #7034
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4badbe996..ffdc01c3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -807,7 +807,11 @@ endif()
option(ENABLE_UNIX_SOCKETS "Define if you want Unix domain sockets support" ON)
if(ENABLE_UNIX_SOCKETS)
include(CheckStructHasMember)
- check_struct_has_member("struct sockaddr_un" sun_path "sys/un.h" USE_UNIX_SOCKETS)
+ if(WIN32)
+ set(USE_UNIX_SOCKETS ON)
+ else()
+ check_struct_has_member("struct sockaddr_un" sun_path "sys/un.h" USE_UNIX_SOCKETS)
+ endif()
else()
unset(USE_UNIX_SOCKETS CACHE)
endif()