Compiling mixed C/Cpp code in Main fails after updating from platform 6.13.0 to 7.0.0

Since I updated my environnement through PlatformIo in VScode, my projects don’t compile anymore.

To reproduce the error:

  • A main.cpp file (instead of a main.c) AND
  • Adding an external Pio lib in C AND
  • Platform = espressif32 @ 7.0.x (but compiles fine with version 6.13.0)

Compile error :

Compiling .pio/build/esp32-c3-devkitm-1/libfcc/esp_type_utils/type_utils.o
**cc1: error: command-line option '-fuse-cxa-atexit' is valid for C++/ObjC++ but not for C \[-Werror\]**
Compiling .pio/build/esp32-c3-devkitm-1/libb29/esp_bmp280/bmp280.o
Archiving .pio/build/esp32-c3-devkitm-1/bootloader/esp-idf/spi_flash/libspi_flash.a
Indexing .pio/build/esp32-c3-devkitm-1/bootloader/esp-idf/spi_flash/libspi_flash.a
cc1: all warnings being treated as errors
**cc1: error: command-line option '-fuse-cxa-atexit' is valid for C++/ObjC++ but not for C \[-Werror\]**
\*\*\* \[.pio/build/esp32-c3-devkitm-1/libfcc/esp_type_utils/type_utils.o\] Error 1
cc1: all warnings being treated as errors
\*\*\* \[.pio/build/esp32-c3-devkitm-1/libb29/esp_bmp280/bmp280.o\] Error 1

This is my platformio.ini file :

[env:esp32-c3-devkitm-1]
platform = espressif32 @ 7.0.0 ;fails  ;6.13.0 compiles
board = esp32-c3-devkitm-1
framework = espidf
lib_deps = k0i05/esp_bmp280@^1.2.7

I spent I few hours trying to fix this with no luck. I noticed a ESP-IDF GitHub issue that seems similar, but I couldn’t find the changes to the CMakeList to make the work around they suggest: Leaking C++ flags when building together with C only dependency (IDFGH-17629) #18552

Any ideas? Should I report a bug?