The mbed-lorawan library is converted from an INTERFACE to an OBJECT.
However, the board specific LoRaWAN device drivers are now individual
INTERFACE CMake library targets that link with mbed-lorawan if
they are included in the build.
The mbed-nfc library is converted from an INTERFACE to an OBJECT.
However, the board specific NFC device drivers are now individual
INTERFACE CMake library targets that link with mbed-nfc if
they are included in the build.
Libraries require mbedtls drivers paths to get mbedtls configuration.
To get driver to mbedtls, we need to link privately, not exposing object files to the consumers of mbed-tls. And provide publicly headers, as drivers are part of mbedtls, they must be also available.
To achieve this, we have to take one source from nanostack otherwise
we pull in entire nanostack and hit some deps issue
This will be cleaned up once we look closer at nanostack & netsockets.
Nanostack can be static library, only few files have weak symbols (related to netsockets and Mbed OS).
This is how application gets in mbedtls driver header:
```
In file included from ../../../../mbed-os/connectivity/mbedtls/./include/mbedtls/config.h:31,
from ../../../../mbed-os/connectivity/mbedtls/./include/mbedtls/platform.h:37,
from ../../../../mbed-os/connectivity/netsocket/./include/netsocket/TLSSocketWrapper.h:28,
from ../../../../mbed-os/connectivity/netsocket/./include/netsocket/nsapi.h:45,
from ../../../../mbed-os/mbed.h:27,
from ../../../../source/main.cpp:17:
../../../../mbed-os/connectivity/mbedtls/./platform/inc/platform_mbed.h:47:10: fatal error: mbedtls_device.h: No such file or directory
47 | #include "mbedtls_device.h"
```
Drivers to be the last, and the stack first.
This can be reverted once drivers are either part of the stack (moved) or we get
add/remove libraries from targets (how a target can request additional driver, this
works now due to using target labels).