From 7ebc4fd9d9e3bc0f5b386779949060e8a6635ed7 Mon Sep 17 00:00:00 2001 From: huangxin Date: Tue, 14 Mar 2023 09:55:40 +0800 Subject: [PATCH] =?UTF-8?q?OCT=201.=20=E7=A7=BB=E9=99=A4=E9=9D=9E=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E6=83=85=E5=86=B5=E4=B8=8B=E7=9A=84zmq=E5=BA=93?= =?UTF-8?q?=E8=B0=83=E7=94=A8=202.=20=E8=BF=9B=E7=A8=8B=E5=8F=A5=E6=9F=84?= =?UTF-8?q?=E4=BC=98=E5=8C=96266-->116?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- depend/third_libs.cmake | 5 +++-- srcs/libs/cmdline/cmd_menu.c | 7 +++++-- srcs/libs/{cmdline => mq}/mq_cmd.c | 0 3 files changed, 8 insertions(+), 4 deletions(-) rename srcs/libs/{cmdline => mq}/mq_cmd.c (100%) diff --git a/depend/third_libs.cmake b/depend/third_libs.cmake index 284cf67..71d7fb2 100644 --- a/depend/third_libs.cmake +++ b/depend/third_libs.cmake @@ -4,8 +4,9 @@ INCLUDE(FetchContent) PKG_SEARCH_MODULE(LIBCURL QUIET libcurl) PKG_SEARCH_MODULE(LIBSSL QUIET libssl) PKG_SEARCH_MODULE(LIBCRYPTO QUIET libcrypto) -PKG_SEARCH_MODULE(LIBZMQ QUIET libzmq) - +IF (USED_ZMQ) + PKG_SEARCH_MODULE(LIBZMQ QUIET libzmq) +ENDIF () IF ((NOT LIBZMQ_FOUND) OR (NOT LIBCRYPTO_FOUND) OR (NOT LIBSSL_FOUND) OR (NOT LIBCURL_FOUND)) LINUX_INSTALL_SYSTEM_PACKAGE() ENDIF () diff --git a/srcs/libs/cmdline/cmd_menu.c b/srcs/libs/cmdline/cmd_menu.c index 2984ebe..f57c451 100644 --- a/srcs/libs/cmdline/cmd_menu.c +++ b/srcs/libs/cmdline/cmd_menu.c @@ -186,8 +186,11 @@ static int on_cmd2(void *pTbl[], const char *pName, void *pInfo) { } pJsonStr = cJSON_PrintUnformatted(pJsonObj); - ret = mq_cmd_run(pSvr, pJsonStr); - +#ifdef ZEROMQ_ON + ret = mq_cmd_run(pSvr, pJsonStr); +#else + ret = ERR_SUCCESS; +#endif cJSON_Delete(pJsonObj); free((void *)pJsonStr); diff --git a/srcs/libs/cmdline/mq_cmd.c b/srcs/libs/mq/mq_cmd.c similarity index 100% rename from srcs/libs/cmdline/mq_cmd.c rename to srcs/libs/mq/mq_cmd.c