Skip to content

Commit 453f00c

Browse files
authored
Merge pull request #2085 from minrk/cmake-minimum
set CMAKE_POLICY_VERSION_MINIMUM for bundled libzmq
2 parents 7a60063 + 0fc39af commit 453f00c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CMakeLists.txt

+10
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,16 @@ if (ZMQ_PREFIX STREQUAL "bundled")
303303
endif()
304304

305305
# use libzmq's own cmake, so we can import the libzmq-static target
306+
# libzmq uses an ancient policy minimum, no longer supported
307+
if ("${CMAKE_POLICY_VERSION_MINIMUM}" STREQUAL "")
308+
# workaround https://github.com/zeromq/libzmq/pull/4776
309+
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.31")
310+
set(CMAKE_POLICY_VERSION_MINIMUM "3.31")
311+
else()
312+
set(CMAKE_POLICY_VERSION_MINIMUM "${CMAKE_VERSION_MAJOR}.${CMAKE_VERSION_MINOR}")
313+
endif()
314+
message(STATUS "Setting CMAKE_POLICY_VERSION_MINIMUM=${CMAKE_POLICY_VERSION_MINIMUM} for libzmq")
315+
endif()
306316
set(ENABLE_CURVE ON)
307317
set(ENABLE_DRAFTS ${ZMQ_DRAFT_API})
308318
set(ENABLE_LIBSODIUM_RANDOMBYTES_CLOSE "OFF")

0 commit comments

Comments
 (0)