OCT ZNJK-1000 更新CMake编译脚本选项

This commit is contained in:
huangxin 2022-09-27 17:43:16 +08:00
parent 99d7f1ff97
commit 0adceb1000
4 changed files with 28 additions and 19 deletions

View File

@ -32,10 +32,13 @@ endif ()
if (USED_LWIP)
MESSAGE("Select Option USED_LWIP")
ADD_SUBDIRECTORY(srcs/lwip)
endif ()
if (USED_OPENDHCPD)
MESSAGE("Select Option USED_OPENDHCPD")
ADD_SUBDIRECTORY(srcs/open_dhcp)
endif ()
if (USED_LWIP OR VCPE_AGENT)
ADD_SUBDIRECTORY(srcs/lwip)
endif ()

View File

@ -11,12 +11,15 @@ include(ExternalProject)
#
FIND_PACKAGE(PkgConfig)
if (USED_LWIP OR VCPE_AGENT)
PKG_SEARCH_MODULE(LIBCURL REQUIRED libcurl)
PKG_SEARCH_MODULE(LIBSSL REQUIRED libssl)
PKG_SEARCH_MODULE(LIBCRYPTO REQUIRED libcrypto)
LIST(APPEND COMMON_LIBS "${LIBCURL_LDFLAGS} ${LIBSSL_LDFLAGS} ${LIBCRYPTO_LDFLAGS}")
LIST(APPEND COMMON_LIBS "-ldl -lpthread -lzlog -lm -luv -lzmq -luuid -lconfig")
endif ()
SET(COMMON_LIBS ${LIBCURL_LDFLAGS} ${LIBSSL_LDFLAGS} ${LIBCRYPTO_LDFLAGS})
SET(COMMON_LIBS ${COMMON_LIBS} "-ldl -lpthread -lzlog -lm -luv -lzmq -luuid -lconfig")
LIST(APPEND COMMON_LIBS "-lpthread")
INCLUDE_DIRECTORIES(include ./ ./include ./libs/include ./lwip/src/include ./lwip/src/arch_linux/include ${COMMON_INCLUDE})

View File

@ -7,6 +7,9 @@ include(ExternalProject)
INCLUDE_DIRECTORIES(include ./ ./include ../lwip/src/include ../lwip/src/arch_linux/include ../include ${COMMON_INCLUDE})
FILE(GLOB C_HEADS include/*.h include/uthash/*.h include/s2j/*.h)
AUX_SOURCE_DIRECTORY(json C_SRC)
if (USED_LWIP OR VCPE_AGENT)
AUX_SOURCE_DIRECTORY(args C_SRC)
AUX_SOURCE_DIRECTORY(init C_SRC)
AUX_SOURCE_DIRECTORY(misc C_SRC)
@ -18,8 +21,8 @@ AUX_SOURCE_DIRECTORY(task C_SRC)
AUX_SOURCE_DIRECTORY(mq C_SRC)
AUX_SOURCE_DIRECTORY(cmdline C_SRC)
AUX_SOURCE_DIRECTORY(crypto C_SRC)
AUX_SOURCE_DIRECTORY(json C_SRC)
AUX_SOURCE_DIRECTORY(hardware C_SRC)
endif ()
SET(CMAKE_C_STANDARD 99)

View File

@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(../libs/include ./)
FILE(GLOB DHCPD_HEADS ./*.h)
add_definitions(-Wno-format-overflow)
ADD_DEFINITIONS(-Wno-format-overflow)
#ADD_EXECUTABLE(${PROJECT_TARGET} opendhcpd.cpp ${DHCPD_HEADS})
ADD_LIBRARY(${DHCPD_PROJECT_TARGET} opendhcpd.cpp ${DHCPD_HEADS})