@@ -111,12 +111,16 @@ option(HTTPLIB_REQUIRE_ZSTD "Requires ZSTD to be found & linked, or fails build.
111111option (HTTPLIB_USE_ZSTD_IF_AVAILABLE "Uses ZSTD (if available) to enable zstd support." ON )
112112# Defaults to static library
113113option (BUILD_SHARED_LIBS "Build the library as a shared library instead of static. Has no effect if using header-only." OFF )
114- if (BUILD_SHARED_LIBS AND WIN32 AND HTTPLIB_COMPILE)
114+ if (BUILD_SHARED_LIBS AND WIN32 AND HTTPLIB_COMPILE)
115115 # Necessary for Windows if building shared libs
116116 # See https://stackoverflow.com/a/40743080
117117 set (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON )
118118endif ()
119119
120+ if ( CMAKE_SYSTEM_NAME MATCHES "Windows" AND ${CMAKE_SYSTEM_VERSION} VERSION_LESS "10.0.0" )
121+ message (SEND_ERROR "Windows ${CMAKE_SYSTEM_VERSION} or lower is not supported. Please use Windows 10 or later." )
122+ endif ()
123+
120124# Set some variables that are used in-tree and while building based on our options
121125set (HTTPLIB_IS_COMPILED ${HTTPLIB_COMPILE} )
122126set (HTTPLIB_IS_USING_CERTS_FROM_MACOSX_KEYCHAIN ${HTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN} )
@@ -243,8 +247,8 @@ add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
243247target_compile_features (${PROJECT_NAME} ${_INTERFACE_OR_PUBLIC} cxx_std_11)
244248
245249target_include_directories (${PROJECT_NAME} SYSTEM ${_INTERFACE_OR_PUBLIC}
246- $<BUILD_INTERFACE:${_httplib_build_includedir} >
247- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} >
250+ $<BUILD_INTERFACE:${_httplib_build_includedir} >
251+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} >
248252)
249253
250254# Always require threads
@@ -340,6 +344,6 @@ if(HTTPLIB_INSTALL)
340344endif ()
341345
342346if (HTTPLIB_TEST)
343- include (CTest)
344- add_subdirectory (test )
347+ include (CTest)
348+ add_subdirectory (test )
345349endif ()
0 commit comments