diff --git a/components/cbor/CMakeLists.txt b/components/cbor/CMakeLists.txt index 7f12fbe9c9..f213c22733 100644 --- a/components/cbor/CMakeLists.txt +++ b/components/cbor/CMakeLists.txt @@ -13,3 +13,8 @@ idf_component_register(SRCS "tinycbor/src/cborencoder_close_container_checked.c" # for open_memstream.c set_source_files_properties(tinycbor/src/open_memstream.c PROPERTIES COMPILE_DEFINITIONS "__linux__") + +# workaround for the fact that we are passing -ffreestanding to Clang +if(CMAKE_C_COMPILER_ID MATCHES "Clang") + target_compile_options(${COMPONENT_LIB} PRIVATE "-U __STDC_HOSTED__") +endif()