arduino-cmake / Arduino-CMake-NG

CMake-Based framework for Arduino platforms
MIT License
138 stars 39 forks source link

Inconsistent platform libraries API #66

Closed MrPointer closed 5 years ago

MrPointer commented 5 years ago

Based on the amount of related issues opened lately, and a general feedback from community - It seems that the current API of platform libraries isn't clear enough, and inconsistent with the API of other types of libraries.

The biggest problem is that the general library API is based on finding them, then linking them to a target, just as one would do in "ordinary" CMake. However, since platform libraries are essential to Arduino development and their location is known once the entire platform is found - Logically, they don't seem to be needed to be found, thus requiring users only to link them to targets. This, as it turns out, is not so "logical" afterwards, and should be addressed differently.

Edit: ~~It appears that there's a serious lack of support for direct usage of platform libraries. While these can be perfectly used by other libraries, such as 3rd party libs, users can't use them directly as part of their application now - It should be addressed immediately.~~ Platform libraries can be linked to cmake targets using the link_platform_library function.