I am working with a legacy code that developed in Centos 8. Now, I have to build it in the Debian 12 (We don't have any problem in Centos!). One of the project dependencies is zmq that build with below script in a CMakeLists.txt file.
add_compile_options(-std=c++14 -O3 -pedantic-errors)set(LOCAL_REPO $ENV{HOME}/workspace/localrepo)set(TARGET_NAME zmq)set(TARGET_VERSION 4.3.4)ExternalProject_Add(${TARGET_NAME}_source PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME} URL ${LOCAL_REPO}/zeromq-${TARGET_VERSION}.tar.gz UPDATE_COMMAND "" CONFIGURE_COMMAND PKG_CONFIG_PATH=${EXTERNAL_INSTALL_LOCATION}/lib/pkgconfig ./configure --prefix=${EXTERNAL_INSTALL_LOCATION} --with-libsodium --disable-curve BUILD_COMMAND make INSTALL_COMMAND make install BUILD_IN_SOURCE ON LOG_DOWNLOAD OFF LOG_INSTALL ON DEPENDS libsodium_source)
After building the below error is shown:
[ 50%] Built target libsodium_source[ 56%] Built target msgpack-c_source[ 61%] Built target leveldb_source[ 63%] Built target logging[ 63%] Performing configure step for 'zmq_source'checking for ......checking for libsodium... no./configure: line 421: test: then: integer expression expectedconfigure: error: run./configure: line 310: return: then: numeric argument required./configure: line 320: exit: then: numeric argument requiredgmake[3]: *** [engine/thirdparty/CMakeFiles/zmq_source.dir/build.make:93: engine/thirdparty/zmq/src/zmq_source-stamp/zmq_source-configure] Error 2gmake[2]: *** [CMakeFiles/Makefile2:502: engine/thirdparty/CMakeFiles/zmq_source.dir/all] Error 2gmake[1]: *** [CMakeFiles/Makefile2:249: engine/CMakeFiles/mee.dir/rule] Error 2
Some details:
1- cmake version 3.25.12- gcc (Debian 12.2.0-14) 12.2.03- g++ (Debian 12.2.0-14) 12.2.0
I removed --with-libsodium and --disable-curve. Now error is changed:
[ 64%] Performing build step for 'zmq_source'make[4]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.Making all in doc CXX tests/libtestutil_a-testutil_monitoring.otests/testutil_monitoring.cpp: In function ‘int64_t get_monitor_event_internal_v2(void*, uint64_t*, char**, char**, int)’:tests/testutil_monitoring.cpp:252:30: error: comparing the result of pointer addition ‘(value_ + ((sizetype)(i * 8)))’ and NULL [-Werror=address] 252 | if (value_ && value_ + i) | ~~~~~~~^~~cc1plus: all warnings being treated as errorsmake[5]: *** [Makefile:5318: tests/libtestutil_a-testutil_monitoring.o] Error 1make[4]: *** [Makefile:8217: all-recursive] Error 1gmake[3]: *** [engine/thirdparty/CMakeFiles/zmq_source.dir/build.make:86: engine/thirdparty/zmq/src/zmq_source-stamp/zmq_source-build] Error 2gmake[2]: *** [CMakeFiles/Makefile2:502: engine/thirdparty/CMakeFiles/zmq_source.dir/all] Error 2gmake[1]: *** [CMakeFiles/Makefile2:249: engine/CMakeFiles/mee.dir/rule] Error 2
Is there any way to disable "all warnings being treated as errors" in ExternalProject_Add?Although I don't know after resolve this error, my problem will be solved or not.