Commit Graph

204 Commits (feature-cmake-object-libraries)

Author SHA1 Message Date
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 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 b2fd9f67c2 CMake emac: add missing events 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 89bcb5b12b CMake emac: revert back to using labels 2021-03-15 10:10:36 +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 f15618a7c2 CMake mbedtls: fix naming 2021-03-15 10:10:27 +00:00
Martin Kojtal 4c15d591d6 CMake cellular: fix drivers linking errors 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 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 9e5394ffa0 CMake ble drivers: fix adding RTOS as library as they require it 2021-03-15 10:06:16 +00:00
Martin Kojtal 2b0de42606 CMake ble: add a comment why drivers are INTERFACE lib
If it is an OBJECT it would need mbed-ble and mbed-core. As we want to link these drivers to
mbed-ble to be available for an app (the only required step for an app is to link to mbed-ble and
we figure out internally what is required for a specific board - using config library add/remove).

This can be refactored once we get CMake config story to replace our config (or at least targets.json information like add/remove libraries).
2021-03-15 10:06:14 +00:00
Martin Kojtal 3d5a0ad091 CMake ble: bring back labels 2021-03-15 10:06:13 +00:00
Martin Kojtal b9c8fd9765 CMake ble: link drivers to ble 2021-03-15 10:06:13 +00:00
Martin Kojtal 1f503dcd86 CMake ble: remove not completed add/remove libraries from targets
This needs much more time to be done properly. Use what we have currently to be able to
use mbed-ble as object library.

Once we get add/remove libraries from targets, fix should be easier as we already have
own CMake targets per driver, just connect them together with mbed-ble on request.
2021-03-15 10:06:11 +00:00
Martin Kojtal dfd8ec8474 CMake ble: fix naming CMake libraries, using - 2021-03-15 10:06:08 +00:00
Martin Kojtal c67ccc3ebd CMake ble: revert the move 2021-03-15 10:06:08 +00:00
Martin Kojtal db35bbdc43 CMake ble: remove component add function, use regular variable
use MBED_<library>_EXTRA_LIBRARIES variables we provide
2021-03-15 10:06:07 +00:00
Martin Kojtal 4e977fc5a8 CMake ble drivers: add EXCLUDE_FROM_ALL to optional drivers 2021-03-15 10:06:06 +00:00
Martin Kojtal 971ced8ec6 CMake ble drivers: remove linking core and ble - they are default for ble 2021-03-15 10:06:06 +00:00
Martin Kojtal 6b7b1406c3 CMake ble: revert drivers inclusion 2021-03-15 10:06:05 +00:00
Martin Kojtal ab8ea63d80 CMake Cypress: add extra libraries to mbed-ble 2021-03-15 10:06:03 +00:00
Martin Kojtal 40525e1a3c CMake ble: fix libraries in drivers 2021-03-15 10:06:00 +00:00
Martin Kojtal 1c3ae9b7cd CMake ble: set library as OBJECT
mbed-ble to be OBJECT library.

Cordio is interface as it is part of mbed-ble but as an external component that we fetch from upstream cordio repository.
2021-03-15 10:06:00 +00:00
Martin Kojtal 1cb25da7ae
Merge pull request #14419 from jeromecoutant/PR_MBEDH
STM32: remove mbed.h include in connectivity
2021-03-12 10:55:32 +00:00
jeromecoutant a7508f70fe STM32WB BLE: remove mbed.h 2021-03-11 17:39:06 +01:00
jeromecoutant d28b875727 STM32 EMAC: remove mbed.h 2021-03-11 17:38:56 +01:00
Hugues Kamba 4367305830 CMake: Fix Renesas build error on Linux
The CMake input source file needs to be named
exactly CMakeLists.txt to be detected and used
for the build configuration.
2021-03-11 11:43:37 +00:00
Martin Kojtal 76b2902f48
Merge pull request #14354 from ARMmbed/feature-tf-m-1.2-integration
Update TF-M support to v1.2
2021-03-03 11:08:24 +00:00
Lingkai Dong 0dd43976b8 Import mbedtls_ecp_write_key for Cypress Mbed TLS driver
Mbed TLS 2.24.0 has added a new function mbedtls_ecp_write_key()
which is the reverse of the existing mbedtls_ecp_read_key(). This
function should be platform agnostic, but needs to be copied into
Cypress's hardware-accelerated ECP driver as part of the updated
API.
2021-02-25 14:02:57 +00:00
Arto Kinnunen e4e2f79cc8 Update stm32xx_emac traces
- Make packet trace optional, can be enabled by enabling macro
  STM32xx_DEEP_TRACE
- Shorten traces during driver initialisation to avoid problems with
  driver startup when soft reset is used.
2021-02-24 13:46:58 +02:00
Martin Kojtal 85c2d7a25c CMake: remove IAR references as they are not supported 2021-02-17 09:19:03 +00:00
Martin Kojtal 3894d73680
Merge pull request #14289 from hugueskamba/hk_cmake_refactor_cypress
CMake: Refactor Cypress targets
2021-02-16 13:43:35 +00:00
Hugues Kamba ea6955bd1c CMake: Refactor Cypress targets
Refactor all Cypress targets to be CMake buildsystem targets. This removes
the need for checking MBED_TARGET_LABELS repeatedly and allows us to be
more flexible in the way we include MBED_TARGET source in the build.

A side effect of this is it will allow us to support custom targets
without breaking the build for 'standard' targets, as we use CMake's
standard mechanism for adding build rules to the build system, rather
than implementing our own layer of logic to exclude files not needed for
the target being built. Using this approach, if an MBED_TARGET is not
linked to using target_link_libraries its source files will not be
added to the build. This means custom target source can be added to the
user's application CMakeLists.txt without polluting the build system
when trying to compile for a standard MBED_TARGET.
2021-02-15 17:20:23 +00:00
Martin Kojtal fa62e80958
Merge pull request #14249 from jeromecoutant/PR_STM32WL_LORA
STM32WL : add LoRa support
2021-02-15 11:04:00 +00:00
Martin Kojtal bc6679ebd6
Wiced: remove empty spaces 2021-02-15 08:49:44 +00:00
jeromecoutant 81a44fc9ae STM32WL: use correct include path 2021-02-15 08:54:06 +01:00
Martin Kojtal 51a6754e22
WicedInterface: fix styling 2021-02-14 20:00:25 +00:00