Commit Graph

32788 Commits (feature-cmake-object-libraries)

Author SHA1 Message Date
Martin Kojtal fd32ed0049
Merge pull request #14427 from hugueskamba/hk_cmake_object_lorawan_refactor
CMake: Convert mbed-lorawan CMake library target to OBJECT
2021-03-15 15:39:13 +01:00
Hugues Kamba 6711ff5308 CMake: Convert mbed-lorawan CMake library target to OBJECT
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.
2021-03-15 10:38:34 +00:00
Hugues Kamba 6de5e70c15 CMake: Convert mbed-nfc CMake library target to OBJECT
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.
2021-03-15 10:10:47 +00:00
Martin Kojtal 9f48b95f5b CMake netsocket: expose events and tls as they will be needed in the app as well 2021-03-15 10:10:47 +00:00
Martin Kojtal 0fa8c1ca54 CMake nanostack: cmsis part links to main component, do not need to provide link libs 2021-03-15 10:10:47 +00:00
Martin Kojtal 519bd2011f CMake netsocket: move tls to be privately linked 2021-03-15 10:10:46 +00:00
Martin Kojtal ade64d47ed CMake netsocket: link publicly mbedtls to expose mbedtls to an application 2021-03-15 10:10:46 +00:00
Martin Kojtal 430e2ec4c8 CMake mbedtls: static library, now weak symbols involved 2021-03-15 10:10:46 +00:00
Martin Kojtal 5e7d7a62a7 CMake mbedtls drivers: link to mbedtls PRIVATE and expose headers
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.
2021-03-15 10:10:45 +00:00
Martin Kojtal f71e2186e3 CMake randlib: STATIC library
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).
2021-03-15 10:10:45 +00:00
Martin Kojtal 97e80d7b04 CMake connectivity: fix conflict from rebase 2021-03-15 10:10:45 +00:00
Martin Kojtal b2fd9f67c2 CMake emac: add missing events 2021-03-15 10:10:44 +00:00
Martin Kojtal d68fa4b6e2 CMake connectivity: move netsocket/mbedtls add library 2021-03-15 10:10:44 +00:00
Martin Kojtal 04b4ab5bea CMake events: static library
No weak symbols, this can be static library.

This also resolves a problem with object libraries https://gitlab.kitware.com/cmake/cmake/-/issues/18090.
2021-03-15 10:10:44 +00:00
Martin Kojtal 78f6aeaf86 CMake connectivity: fix nanostack libraries linking 2021-03-15 10:10:44 +00:00
Martin Kojtal 6ef35fe585 CMake netsockets: fix emac drivers to link to emac 2021-03-15 10:10:43 +00:00
Martin Kojtal 3e271910c5 CMake connectivity: fix linking to mbedtls, header from drivers must be exposed
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"
```
2021-03-15 10:10:37 +00:00
Martin Kojtal c38fabebdf CMake emac stm32: fix missing library 2021-03-15 10:10:37 +00:00
Martin Kojtal 1a4fd8a72a CMake connectivity: revert ble change and cellular interface 2021-03-15 10:10:36 +00:00
Martin Kojtal 89bcb5b12b CMake emac: revert back to using labels 2021-03-15 10:10:36 +00:00
Martin Kojtal 8cb8eb8f46 CMake netsocket: remove unused variable MBED_NETSOCKET_EXTRA_LIBRARIES 2021-03-15 10:10:28 +00:00
Martin Kojtal 4c5f1d8577 CMake cellular: link each driver separately
I also reverted the previous change to STM component. We do not yet have functionality to
include/exclude drivers in CMake within Mbed OS.
2021-03-15 10:10:28 +00:00
Martin Kojtal ce0354d74a CMake nanostack: fix naming libraries, use `-` 2021-03-15 10:10:28 +00:00
Martin Kojtal f15618a7c2 CMake mbedtls: fix naming 2021-03-15 10:10:27 +00:00
Martin Kojtal 25d1d91c53 CMake ppp: move add library to its origin 2021-03-15 10:10:27 +00:00
Martin Kojtal da070c5f28 CMake: fix nanostack and netsockets linking libraries 2021-03-15 10:10:27 +00:00
Martin Kojtal 689b29553a CMake lwipstack: remove comment and linking, lwipstack is part of netsockets 2021-03-15 10:10:26 +00:00
Martin Kojtal 9821f11f0b CMake nanostack libservice: fix core depdency 2021-03-15 10:10:26 +00:00
Martin Kojtal 4e2d461fe5 CMake coap: this library can be static 2021-03-15 10:10:26 +00:00
Martin Kojtal 6d3169f623 CMake libraries: do not always include them 2021-03-15 10:10:26 +00:00
Martin Kojtal 920b5f4969 CMake randlib: this can be static library 2021-03-15 10:10:25 +00:00
Martin Kojtal 4c15d591d6 CMake cellular: fix drivers linking errors 2021-03-15 10:10:25 +00:00
Martin Kojtal 2c042cf453 CMake connectivity: all folders are optional 2021-03-15 10:10:25 +00:00
Martin Kojtal b470821436 CMake: connectivity libraries set to OBJECTS 2021-03-15 10:10:24 +00:00
Martin Kojtal cb1e47e7a5 CMake mbedtls: refactor drivers to be own CMake targets 2021-03-15 10:07:04 +00:00
Martin Kojtal 15aaaaa977 CMake emac: refactor drivers to be own CMake targets 2021-03-15 10:07:03 +00:00
Martin Kojtal 146ca6c602 CMake mbedtls: remove unused CMakelist 2021-03-15 10:06:20 +00:00
Martin Kojtal 053141efdc CMake cellular: drivers are included from root 2021-03-15 10:06:19 +00:00
Martin Kojtal 28dafb36bb CMake cellular: fix where we link, only one place it can be 2021-03-15 10:06:19 +00:00
Martin Kojtal 62b6422c51 CMake cellular: link modem privately to be part only of the object lib 2021-03-15 10:06:19 +00:00
Martin Kojtal 5f1ff1e7fa CMake cellular: add rtos as dependency 2021-03-15 10:06:18 +00:00
Martin Kojtal 708225d692 CMake cellular: fix n2xx library name 2021-03-15 10:06:18 +00:00
Martin Kojtal 83d2131ea4 CMake cellular: refactor drivers to be CMake targets 2021-03-15 10:06:17 +00:00
Martin Kojtal 541970f4fb CMake cellular: create INTERFACE library stmod 2021-03-15 10:06:17 +00:00
Martin Kojtal 03b640033a CMake cellular: set mbed-cellular as OBJECT library 2021-03-15 10:06:16 +00:00
Martin Kojtal 9e5394ffa0 CMake ble drivers: fix adding RTOS as library as they require it 2021-03-15 10:06:16 +00:00
Martin Kojtal d45976a58d CMake ble: move cordio add_library to own modules 2021-03-15 10:06:15 +00:00
Martin Kojtal f931c00a2f CMake connectivity: remove not useful comment 2021-03-15 10:06:15 +00:00
Martin Kojtal 789ac1ccd0 CMake connectivity: fix drivers inclusion
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).
2021-03-15 10:06:15 +00:00
Martin Kojtal e4f87d11fe CMake connectivity: expose mbed-ble as drivers link to it 2021-03-15 10:06:15 +00:00