]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: prefill/cache `HAVE_STRUCT_SOCKADDR_STORAGE`
authorViktor Szakats <commit@vsz.me>
Tue, 12 Dec 2023 22:00:59 +0000 (22:00 +0000)
committerViktor Szakats <commit@vsz.me>
Mon, 18 Dec 2023 14:56:56 +0000 (14:56 +0000)
Also add missing include to `OtherTests.cmake`. It didn't cause an issue
because the parent already included this earlier by chance.

Closes #12537

CMake/OtherTests.cmake
CMake/Platforms/WindowsCache.cmake

index a7599c44d7fcb41b5027add89c2f610565718848..ae964f5bf15745ce9ae8173734f010ff95ac0ecf 100644 (file)
@@ -23,6 +23,7 @@
 ###########################################################################
 include(CheckCSourceCompiles)
 include(CheckCSourceRuns)
+include(CheckTypeSize)
 
 # The begin of the sources (macros and includes)
 set(_source_epilogue "#undef inline")
@@ -74,9 +75,9 @@ if(NOT WIN32)
   endif()
 endif()
 
-check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE)
-if(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
-  set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
+if(NOT DEFINED HAVE_STRUCT_SOCKADDR_STORAGE)
+  check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE)
+  set(HAVE_STRUCT_SOCKADDR_STORAGE ${HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE})
 endif()
 
 unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
index ec09fd4bd198a65742067c1945942d95d3ac15b6..d3391d92f87f959aa196e72e12113b2da0621505 100644 (file)
@@ -171,6 +171,7 @@ set(HAVE_POSIX_STRERROR_R 0)
 set(HAVE_BUILTIN_AVAILABLE 0)
 set(HAVE_MSG_NOSIGNAL 0)
 set(HAVE_STRUCT_TIMEVAL 1)
+set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
 
 set(HAVE_GETHOSTBYNAME_R_3 0)
 set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)