From 7012e765e1315afa43b37d01fd43c7382a1bd1f8 Mon Sep 17 00:00:00 2001 From: Thomas Beutlich <115483027+thbeu@users.noreply.github.com> Date: Thu, 7 Aug 2025 23:14:19 +0200 Subject: [PATCH] CMake: Check pointer size at configure time (#2197) * Check pointer size at configure time * Relax check to warning --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf036b4..d39958a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,9 +117,12 @@ if(BUILD_SHARED_LIBS AND WIN32 AND HTTPLIB_COMPILE) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() -if( CMAKE_SYSTEM_NAME MATCHES "Windows" AND ${CMAKE_SYSTEM_VERSION} VERSION_LESS "10.0.0") +if(CMAKE_SYSTEM_NAME MATCHES "Windows" AND ${CMAKE_SYSTEM_VERSION} VERSION_LESS "10.0.0") message(SEND_ERROR "Windows ${CMAKE_SYSTEM_VERSION} or lower is not supported. Please use Windows 10 or later.") endif() +if(CMAKE_SIZEOF_VOID_P LESS 8) + message(WARNING "Pointer size ${CMAKE_SIZEOF_VOID_P} is not supported. Please use a 64-bit compiler.") +endif() # Set some variables that are used in-tree and while building based on our options set(HTTPLIB_IS_COMPILED ${HTTPLIB_COMPILE})