Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions crypto/mbedtls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,16 @@ if(CONFIG_CRYPTO_MBEDTLS)
# Library Configuration
# ############################################################################

set_property(
TARGET nuttx
APPEND
PROPERTY NUTTX_INCLUDE_DIRECTORIES ${INCDIR})
set_property(
TARGET nuttx
APPEND
PROPERTY NUTTX_CXX_INCLUDE_DIRECTORIES ${INCDIR})

nuttx_add_library(mbedtls STATIC)
target_sources(mbedtls PRIVATE ${CSRCS})
target_include_directories(mbedtls PRIVATE ${INCDIR})
target_include_directories(mbedtls PUBLIC ${INCDIR})
nuttx_export_header(TARGET mbedtls INCLUDE_DIRECTORIES ${MBEDTLS_DIR}/include)
# Overlay mbedtls_config.h cannot be in the same nuttx_export_header() as
# ${MBEDTLS_DIR}/include (duplicate path). Alt headers need no export; INCDIR
# supplies them for this library only.
file(CREATE_LINK ${CMAKE_CURRENT_LIST_DIR}/include/mbedtls/mbedtls_config.h
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @fdcavalcanti, Perhaps it would be better to use function

nuttx_create_symlink

https://github.com/apache/nuttx/blob/master/cmake/nuttx_create_symlink.cmake

${NUTTX_APPS_BINDIR}/include/mbedtls/mbedtls/mbedtls_config.h
COPY_ON_ERROR SYMBOLIC)
target_compile_definitions(mbedtls PRIVATE unix)

if(CONFIG_ARCH_SIM)
Expand Down
14 changes: 9 additions & 5 deletions netutils/mqttc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if(CONFIG_NETUTILS_MQTTC)
FetchContent_Declare(
mqttc_fetch
URL ${MQTTC_URL}/${CONFIG_NETUTILS_MQTTC_VERSION}.tar.gz SOURCE_DIR
${MQTTC_DIR} BINARY_DIR ${CMAKE_BINARY_DIR}/apps/netutils/mqttc/MQTT-C
${MQTTC_DIR} BINARY_DIR ${NUTTX_APPS_BINDIR}/netutils/mqttc/MQTT-C
DOWNLOAD_NO_PROGRESS true
TIMEOUT 30)

Expand All @@ -44,9 +44,8 @@ if(CONFIG_NETUTILS_MQTTC)
endif()

execute_process(
COMMAND
sh -c
"cat 0001_add_connection_status.patch | patch -s -N -d $(MQTTC_DIR) -p1"
COMMAND patch -s -N -d ${MQTTC_DIR} -p1 -i
${CMAKE_CURRENT_LIST_DIR}/0001_add_connection_status.patch
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
endif()

Expand All @@ -65,6 +64,10 @@ if(CONFIG_NETUTILS_MQTTC)
target_sources(mqttc PRIVATE ${CSRCS})
target_compile_options(mqttc PRIVATE ${CFLAGS})

if(CONFIG_NETUTILS_MQTTC_WITH_MBEDTLS AND CONFIG_CRYPTO_MBEDTLS)
nuttx_add_dependencies(TARGET mqttc DEPENDS mbedtls)
endif()

if(CONFIG_NETUTILS_MQTTC_EXAMPLE)
if(CONFIG_NETUTILS_MQTTC_WITH_MBEDTLS)
nuttx_add_application(
Expand All @@ -79,7 +82,8 @@ if(CONFIG_NETUTILS_MQTTC)
COMPILE_FLAGS
${CFLAGS}
DEPENDS
mqttc)
mqttc
mbedtls)
else()
set(MQTT_PUB_CFLAGS
${CFLAGS}
Expand Down
Loading