mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #14267 from harmut01/refactor_nordic
CMake: Refactor Nordic targets to be CMake buildsystem targetspull/14235/head
commit
de8086b528
|
@ -1,11 +1,11 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if("NRF5x" IN_LIST MBED_TARGET_LABELS)
|
add_subdirectory(TARGET_NRF5x EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(TARGET_NRF5x)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
add_library(mbed-nordic INTERFACE)
|
||||||
|
|
||||||
|
target_include_directories(mbed-nordic
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,20 +1,17 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if("NRF52" IN_LIST MBED_TARGET_LABELS)
|
add_subdirectory(TARGET_NRF52 EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(TARGET_NRF52)
|
add_subdirectory(TARGET_SDK_15_0 EXCLUDE_FROM_ALL)
|
||||||
endif()
|
|
||||||
|
|
||||||
if("SDK_15_0" IN_LIST MBED_TARGET_LABELS)
|
add_library(mbed-nrf5x INTERFACE)
|
||||||
add_subdirectory(TARGET_SDK_15_0)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-nrf5x
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-nrf5x
|
||||||
INTERFACE
|
INTERFACE
|
||||||
lp_ticker.c
|
lp_ticker.c
|
||||||
pinmap.c
|
pinmap.c
|
||||||
|
@ -22,3 +19,5 @@ target_sources(mbed-core
|
||||||
qspi_api.c
|
qspi_api.c
|
||||||
rtc_api.c
|
rtc_api.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-nrf5x INTERFACE mbed-nordic)
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if("MCU_NRF52832" IN_LIST MBED_TARGET_LABELS)
|
add_subdirectory(TARGET_MCU_NRF52832 EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(TARGET_MCU_NRF52832)
|
add_subdirectory(TARGET_MCU_NRF52840 EXCLUDE_FROM_ALL)
|
||||||
elseif("MCU_NRF52840" IN_LIST MBED_TARGET_LABELS)
|
|
||||||
add_subdirectory(TARGET_MCU_NRF52840)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
add_library(mbed-nrf52 INTERFACE)
|
||||||
|
|
||||||
|
target_include_directories(mbed-nrf52
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-nrf52
|
||||||
INTERFACE
|
INTERFACE
|
||||||
PeripheralPinsDefault.c
|
PeripheralPinsDefault.c
|
||||||
analogin_api.c
|
analogin_api.c
|
||||||
|
@ -33,3 +32,5 @@ target_sources(mbed-core
|
||||||
us_ticker.c
|
us_ticker.c
|
||||||
watchdog_api.c
|
watchdog_api.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-nrf52 INTERFACE mbed-nrf5x)
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if("NRF52_DK" IN_LIST MBED_TARGET_LABELS)
|
add_library(mbed-nrf52-dk INTERFACE)
|
||||||
target_include_directories(mbed-core
|
add_library(mbed-sdt52832b INTERFACE)
|
||||||
INTERFACE
|
|
||||||
TARGET_NRF52_DK
|
target_include_directories(mbed-nrf52-dk
|
||||||
)
|
INTERFACE
|
||||||
elseif("SDT52832B" IN_LIST MBED_TARGET_LABELS)
|
TARGET_NRF52_DK
|
||||||
target_include_directories(mbed-core
|
)
|
||||||
INTERFACE
|
|
||||||
TARGET_SDT52832B
|
target_include_directories(mbed-sdt52832b
|
||||||
)
|
INTERFACE
|
||||||
endif()
|
TARGET_SDT52832B
|
||||||
|
)
|
||||||
|
|
||||||
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/nRF52832.sct)
|
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/nRF52832.sct)
|
||||||
|
@ -21,16 +22,16 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_NRF52832.S)
|
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_NRF52832.S)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
add_library(mbed-mcu-nrf52832 INTERFACE)
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-mcu-nrf52832
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
config
|
config
|
||||||
device
|
device
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-mcu-nrf52832
|
||||||
INTERFACE
|
INTERFACE
|
||||||
PeripheralPins.c
|
PeripheralPins.c
|
||||||
|
|
||||||
|
@ -39,3 +40,9 @@ target_sources(mbed-core
|
||||||
|
|
||||||
${STARTUP_FILE}
|
${STARTUP_FILE}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
mbed_set_linker_script(mbed-mcu-nrf52832 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||||
|
|
||||||
|
target_link_libraries(mbed-mcu-nrf52832 INTERFACE mbed-nrf52 mbed-sdk-15-0)
|
||||||
|
target_link_libraries(mbed-nrf52-dk INTERFACE mbed-mcu-nrf52832)
|
||||||
|
target_link_libraries(mbed-sdt52832b INTERFACE mbed-mcu-nrf52832)
|
||||||
|
|
|
@ -1,31 +1,34 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if ("ARDUINO_NANO33BLE" IN_LIST MBED_TARGET_LABELS)
|
add_library(mbed-arduino-nano33ble INTERFACE)
|
||||||
target_include_directories(mbed-core
|
add_library(mbed-ep-agora INTERFACE)
|
||||||
INTERFACE
|
add_library(mbed-ep-atlas INTERFACE)
|
||||||
TARGET_ARDUINO_NANO33BLE
|
add_library(mbed-nrf52840-dk INTERFACE)
|
||||||
)
|
|
||||||
elseif("EP_AGORA" IN_LIST MBED_TARGET_LABELS)
|
target_include_directories(mbed-arduino-nano33ble
|
||||||
target_include_directories(mbed-core
|
INTERFACE
|
||||||
INTERFACE
|
TARGET_ARDUINO_NANO33BLE
|
||||||
TARGET_EP_AGORA
|
)
|
||||||
)
|
|
||||||
target_sources(mbed-core
|
target_include_directories(mbed-ep-agora
|
||||||
INTERFACE
|
INTERFACE
|
||||||
TARGET_EP_AGORA/ONBOARD_TELIT_ME910.cpp
|
TARGET_EP_AGORA
|
||||||
)
|
)
|
||||||
elseif("EP_ATLAS" IN_LIST MBED_TARGET_LABELS)
|
target_sources(mbed-ep-agora
|
||||||
target_include_directories(mbed-core
|
INTERFACE
|
||||||
INTERFACE
|
TARGET_EP_AGORA/ONBOARD_TELIT_ME910.cpp
|
||||||
TARGET_EP_ATLAS
|
)
|
||||||
)
|
|
||||||
elseif("NRF52840_DK" IN_LIST MBED_TARGET_LABELS)
|
target_include_directories(mbed-ep-atlas
|
||||||
target_include_directories(mbed-core
|
INTERFACE
|
||||||
INTERFACE
|
TARGET_EP_ATLAS
|
||||||
TARGET_NRF52840_DK
|
)
|
||||||
)
|
|
||||||
endif()
|
target_include_directories(mbed-nrf52840-dk
|
||||||
|
INTERFACE
|
||||||
|
TARGET_NRF52840_DK
|
||||||
|
)
|
||||||
|
|
||||||
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/nRF52840.sct)
|
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/nRF52840.sct)
|
||||||
|
@ -35,16 +38,16 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_NRF52840.S)
|
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_NRF52840.S)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
add_library(mbed-mcu-nrf52840 INTERFACE)
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-mcu-nrf52840
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
config
|
config
|
||||||
device
|
device
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-mcu-nrf52840
|
||||||
INTERFACE
|
INTERFACE
|
||||||
PeripheralPins.c
|
PeripheralPins.c
|
||||||
USBPhy_Nordic.cpp
|
USBPhy_Nordic.cpp
|
||||||
|
@ -54,3 +57,11 @@ target_sources(mbed-core
|
||||||
|
|
||||||
${STARTUP_FILE}
|
${STARTUP_FILE}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
mbed_set_linker_script(mbed-mcu-nrf52840 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||||
|
|
||||||
|
target_link_libraries(mbed-mcu-nrf52840 INTERFACE mbed-nrf52 mbed-sdk-15-0)
|
||||||
|
target_link_libraries(mbed-arduino-nano33ble INTERFACE mbed-mcu-nrf52840)
|
||||||
|
target_link_libraries(mbed-ep-agora INTERFACE mbed-mcu-nrf52840)
|
||||||
|
target_link_libraries(mbed-ep-atlas INTERFACE mbed-mcu-nrf52840)
|
||||||
|
target_link_libraries(mbed-nrf52840-dk INTERFACE mbed-mcu-nrf52840)
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
if("SOFTDEVICE_NONE" IN_LIST MBED_TARGET_LABELS)
|
add_library(mbed-sdk-15-0 INTERFACE)
|
||||||
add_subdirectory(TARGET_SOFTDEVICE_NONE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_subdirectory(components)
|
add_subdirectory(TARGET_SOFTDEVICE_NONE EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(integration)
|
add_subdirectory(components EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(modules)
|
add_subdirectory(integration EXCLUDE_FROM_ALL)
|
||||||
|
add_subdirectory(modules EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
target_link_libraries(mbed-sdk-15-0 INTERFACE mbed-softdevice-none)
|
|
@ -1,15 +1,16 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
add_library(mbed-softdevice-none INTERFACE)
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-softdevice-none
|
||||||
INTERFACE
|
INTERFACE
|
||||||
libraries
|
libraries
|
||||||
libraries/fstorage
|
libraries/fstorage
|
||||||
nrf_soc_nosd
|
nrf_soc_nosd
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-softdevice-none
|
||||||
INTERFACE
|
INTERFACE
|
||||||
libraries/fstorage/nrf_fstorage_nvmc.c
|
libraries/fstorage/nrf_fstorage_nvmc.c
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-sdk-15-0
|
||||||
INTERFACE
|
INTERFACE
|
||||||
libraries
|
libraries
|
||||||
libraries/atomic
|
libraries/atomic
|
||||||
|
@ -22,7 +22,7 @@ target_include_directories(mbed-core
|
||||||
libraries/util
|
libraries/util
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-sdk-15-0
|
||||||
INTERFACE
|
INTERFACE
|
||||||
libraries/atomic/nrf_atomic.c
|
libraries/atomic/nrf_atomic.c
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-sdk-15-0
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
nrfx
|
nrfx
|
||||||
|
@ -9,7 +9,7 @@ target_include_directories(mbed-core
|
||||||
nrfx/legacy/ble_flash
|
nrfx/legacy/ble_flash
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-sdk-15-0
|
||||||
INTERFACE
|
INTERFACE
|
||||||
nrfx/legacy/nrf_drv_rng.c
|
nrfx/legacy/nrf_drv_rng.c
|
||||||
nrfx/legacy/nrf_drv_usbd.c
|
nrfx/legacy/nrf_drv_usbd.c
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
target_include_directories(mbed-core
|
target_include_directories(mbed-sdk-15-0
|
||||||
INTERFACE
|
INTERFACE
|
||||||
.
|
.
|
||||||
nrfx
|
nrfx
|
||||||
|
@ -16,7 +16,7 @@ target_include_directories(mbed-core
|
||||||
softdevice/common
|
softdevice/common
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(mbed-core
|
target_sources(mbed-sdk-15-0
|
||||||
INTERFACE
|
INTERFACE
|
||||||
nrfx/drivers/src/nrfx_adc.c
|
nrfx/drivers/src/nrfx_adc.c
|
||||||
nrfx/drivers/src/nrfx_clock.c
|
nrfx/drivers/src/nrfx_clock.c
|
||||||
|
|
Loading…
Reference in New Issue