Skip to content

Commit 4566f5b

Browse files
committed
[Telink] Optimize add MbedTLS definitions for Zephyr 3.3 without warnings
1 parent d00d472 commit 4566f5b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

examples/platform/telink/common.cmake

+9-5
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ if(${ZEPHYR_VERSION_STRING} MATCHES "^3\\.3")
2222
set(ZEPHYR_VERSION_OVERLAY_FILE "${CMAKE_BINARY_DIR}/zephyr_version.conf")
2323
file(WRITE ${ZEPHYR_VERSION_OVERLAY_FILE} "CONFIG_ZEPHYR_VERSION_3_3=y\n")
2424

25+
function(add_compile_definitions)
26+
foreach(flag IN LISTS ARGN)
27+
add_definitions(-D${flag})
28+
list(APPEND MATTER_CFLAGS "-D${flag}")
29+
endforeach()
30+
set(MATTER_CFLAGS "${MATTER_CFLAGS}" PARENT_SCOPE)
31+
endfunction()
32+
2533
# Add required MbedTLS defines for Zephyr 3.3
26-
include(${CHIP_ROOT}/config/common/cmake/chip_gn_args.cmake)
27-
matter_add_flags(-DMBEDTLS_HKDF_C=1)
28-
matter_add_flags(-DMBEDTLS_X509_CREATE_C=1)
29-
matter_add_flags(-DMBEDTLS_X509_CSR_WRITE_C=1)
30-
add_definitions(-DMBEDTLS_HKDF_C -DMBEDTLS_X509_CREATE_C -DMBEDTLS_X509_CSR_WRITE_C)
34+
add_compile_definitions(MBEDTLS_HKDF_C MBEDTLS_X509_CREATE_C MBEDTLS_X509_CSR_WRITE_C)
3135
endif()
3236

3337
string(REPLACE "_retention" "" BASE_BOARD ${BOARD})

0 commit comments

Comments
 (0)