From 14020ef9fd526c785c178b0a4a2bb7871da100f0 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 6 Mar 2024 14:57:43 +0100 Subject: [PATCH 1/2] disable dependency tracking, avoid COMMAND_ERROR_IS_FATAL COMMAND_ERROR_IS_FATAL requires cmake 3.19 --- CMakeLists.txt | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index da60cb953..c13531d8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,8 +225,12 @@ if (ZMQ_PREFIX STREQUAL "bundled") COMMAND ${libsodium_build} WORKING_DIRECTORY ${bundled_libsodium_SOURCE_DIR} COMMAND_ECHO STDOUT - COMMAND_ERROR_IS_FATAL ANY + # COMMAND_ERROR_IS_FATAL ANY + RESULT_VARIABLE _status ) + if (_status) + message(FATAL_ERROR "failed to build libsodium") + endif() file(GLOB_RECURSE BUILT_LIB "${bundled_libsodium_SOURCE_DIR}/**/libsodium.lib") message(STATUS "copy ${BUILT_LIB} ${libsodium_lib}") file(COPY_FILE ${BUILT_LIB} ${libsodium_lib}) @@ -235,6 +239,7 @@ if (ZMQ_PREFIX STREQUAL "bundled") ./configure --prefix=${BUNDLE_DIR} --with-pic + --disable-dependency-tracking --disable-shared --enable-static ) @@ -243,20 +248,33 @@ if (ZMQ_PREFIX STREQUAL "bundled") COMMAND ${libsodium_configure} WORKING_DIRECTORY ${bundled_libsodium_SOURCE_DIR} COMMAND_ECHO STDOUT - COMMAND_ERROR_IS_FATAL ANY + # COMMAND_ERROR_IS_FATAL ANY + RESULT_VARIABLE _status ) + # COMMAND_ERROR_IS_FATAL requires cmake 3.19, ubuntu 20.04 has 3.16 + if (_status) + message(FATAL_ERROR "failed to configure libsodium") + endif() execute_process( COMMAND make WORKING_DIRECTORY ${bundled_libsodium_SOURCE_DIR} COMMAND_ECHO STDOUT - COMMAND_ERROR_IS_FATAL ANY + # COMMAND_ERROR_IS_FATAL ANY + RESULT_VARIABLE _status ) + if (_status) + message(FATAL_ERROR "failed to build libsodium") + endif() execute_process( COMMAND make install WORKING_DIRECTORY ${bundled_libsodium_SOURCE_DIR} COMMAND_ECHO STDOUT - COMMAND_ERROR_IS_FATAL ANY + # COMMAND_ERROR_IS_FATAL ANY + RESULT_VARIABLE _status ) + if (_status) + message(FATAL_ERROR "failed to install libsodium") + endif() endif() endif() From bce966b9a0aa59e448456da233bde3e8670bd688 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 6 Mar 2024 15:39:04 +0100 Subject: [PATCH 2/2] run Cython with $Python -mcython more reliable when build isolation is disabled --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c13531d8f..44e06e054 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -369,7 +369,8 @@ else() OUTPUT ${ZMQ_C} DEPENDS ${ZMQ_PYX} VERBATIM - COMMAND "${CYTHON}" + COMMAND "${Python_EXECUTABLE}" + -mcython --3str --output-file ${ZMQ_C} --module-name "zmq.backend.cython._zmq"