Skip to content

Commit 7c281f2

Browse files
fix CMake version check for OpenSSL 1.1+ on Windows (#973)
* fix cmake version check for windows openssl 1.1+ As it stands, this check does not function as intended on the CMake versions that I tried (3.22 and 3.23). I suspect it would not work from CMake 3.10 until CMake 3.70 (were such a version ever to exist); the comparison appears to a floating-point comparison instead of a version comparison. * use available version comparison operator VERSION_GREATER_EQUAL is only available in CMake 3.7+, and we currently need to support older CMake versions than that. Thus we will invert the logic and use VERSION_LESS instead
1 parent 2080803 commit 7c281f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libmongoc/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ if (NOT ENABLE_SSL STREQUAL OFF)
196196
endif ()
197197

198198
if (OPENSSL_FOUND)
199-
if (WIN32 AND OPENSSL_VERSION GREATER 1.1 AND NOT
200-
${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.7)
199+
if (WIN32 AND OPENSSL_VERSION VERSION_GREATER 1.1 AND
200+
${CMAKE_VERSION} VERSION_LESS 3.7)
201201
message (FATAL_ERROR "Building against OpenSSL 1.1.0 and later requires CMake 3.7 or later (hint:"
202202
" You can also compile against Windows Secure Transport with -DENABLE_SSL=WINDOWS")
203203
endif ()

0 commit comments

Comments
 (0)