Skip to content

Commit b90ed64

Browse files
committed
Fix: Fix Windows Cross-Compilation
1 parent 89c932f commit b90ed64

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,14 @@ if(BUILD_SHARED_LIBS AND WIN32 AND HTTPLIB_COMPILE)
117117
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
118118
endif()
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.")
120+
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
121+
if(CMAKE_SYSTEM_VERSION)
122+
if(${CMAKE_SYSTEM_VERSION} VERSION_LESS "10.0.0")
123+
message(SEND_ERROR "Windows ${CMAKE_SYSTEM_VERSION} or lower is not supported. Please use Windows 10 or later.")
124+
endif()
125+
else()
126+
message(WARNING "The target is Windows but CMAKE_SYSTEM_VERSION is not set, the default system version is set to Windows 10 or later.")
127+
endif()
122128
endif()
123129
if(CMAKE_SIZEOF_VOID_P LESS 8)
124130
message(WARNING "Pointer size ${CMAKE_SIZEOF_VOID_P} is not supported. Please use a 64-bit compiler.")

0 commit comments

Comments
 (0)