platformio / builder-framework-mbed

ARM mbed build script for PlatformIO Build System
http://platformio.org/frameworks/mbed
Apache License 2.0
4 stars 17 forks source link

Feature: Change to Mbed CLI 2's CMake Build System #24

Open pearson opened 3 years ago

pearson commented 3 years ago

I'd like to suggest that the PlatformIO Mbed support be switched to the newer Mbed CLI 2 CMake build system. This is the replacement build system being used for Mbed OS v6.5 and higher, and it offers many advantages over the old build system.

The biggest advantage is, of course, that the build system only compiles the libraries that are required for the project. (Finally!) While there have been many comments regarding the compilation speed of Mbed on PlatformIO, this change would make a night and day difference. (For example, a clean build of the standard Blinky example with Mbed CLI 2 under Windows 10 on a Ryzen 5900x system takes 10 seconds.)

A secondary advantage to the new build system is that it will fully take advantage of systems with high CPU core counts. Where the current Mbed build system in PlatformIO might occasionally spike above 50% CPU usage on a system with many cores, the Mbed CMake-based system regularly maxes the CPU out.