Commit 651c0bcd authored by Brad King's avatar Brad King Committed by Daniel Stenberg
Browse files

CMake: Use upstream CheckTypeSize module

The CheckTypeSize module that comes with CMake 2.6.2 and above does
everything we need and also supports cross-compiling.  Avoid duplicating
an older version of it here.  This also fixes a cross-compiling error
because the old line

  include ("${CMAKE_MODULE_PATH}/CheckTypeSize.cmake")

failed because CMAKE_MODULE_PATH is a search path and not a directory.

Signed-off-by: default avatarBrad King <brad.king@kitware.com>
parent d45ed0ec
Loading
Loading
Loading
Loading
−44

File deleted.

−57

File deleted.

+6 −6
Changes for CMakeLists.txt: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -183,13 +183,7 @@ include (CheckIncludeFile)
include (CheckIncludeFiles)
include (CheckLibraryExists)
include (CheckSymbolExists)
# if crosscompiling is on, the CHECK_TYPE_SIZE macro coming with cmake uses
# TRY_COMPILE instead of TRY_RUN which makes crosscompiling easier, Alex
if(CMAKE_CROSSCOMPILING)
  include ("${CMAKE_MODULE_PATH}/CheckTypeSize.cmake")
else(CMAKE_CROSSCOMPILING)
include (CheckTypeSize)
endif(CMAKE_CROSSCOMPILING)

# On windows preload settings
if(WIN32)
@@ -781,7 +775,13 @@ endif(CMAKE_COMPILER_IS_GNUCC AND APPLE)

if(HAVE_SOCKLEN_T)
  set(CURL_TYPEOF_CURL_SOCKLEN_T "socklen_t")
  if(WIN32)
    set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h;ws2tcpip.h")
  elseif(HAVE_SYS_SOCKET_H)
    set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
  endif()
  check_type_size("socklen_t" CURL_SIZEOF_CURL_SOCKLEN_T)
  set(CMAKE_EXTRA_INCLUDE_FILES)
  if(NOT HAVE_CURL_SIZEOF_CURL_SOCKLEN_T)
    message(FATAL_ERROR 
     "Check for sizeof socklen_t failed, see CMakeFiles/CMakerror.log")