Skip to content

Create FLASH CMSIS ALGO target to remove dependency on MBED_TARGET_LABELS #14308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions hal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +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

if("FLASH_CMSIS_ALGO" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_FLASH_CMSIS_ALGO)
endif()
add_subdirectory(TARGET_FLASH_CMSIS_ALGO EXCLUDE_FROM_ALL)

add_subdirectory(usb)

Expand Down
8 changes: 5 additions & 3 deletions hal/TARGET_FLASH_CMSIS_ALGO/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

target_include_directories(mbed-core
add_library(mbed-flash-cmsis-algo INTERFACE)

target_include_directories(mbed-flash-cmsis-algo
INTERFACE
.
)

target_sources(mbed-core
target_sources(mbed-flash-cmsis-algo
INTERFACE
flash_common_algo.c
)
12 changes: 6 additions & 6 deletions hal/tests/TESTS/mbed_hal/qspi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
Expand All @@ -10,15 +10,15 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)

project(${TEST_TARGET})

if("EP_AGORA" IN_LIST MBED_TARGET_LABELS)
if(TARGET mbed-ep-agora)
set(FLASH_TARGET_CONFIG_HEADER NORDIC/EP_AGORA)
elseif("NRF52840_DK" IN_LIST MBED_TARGET_LABELS)
elseif(TARGET mbed-nrf52840-dk)
set(FLASH_TARGET_CONFIG_HEADER NORDIC/NRF52840_DK)
elseif("K82F" IN_LIST MBED_TARGET_LABELS)
elseif(TARGET mbed-k82f)
set(FLASH_TARGET_CONFIG_HEADER NXP/K82F)
elseif("LPC546XX" IN_LIST MBED_TARGET_LABELS)
elseif(TARGET mbed-lpc546xx)
set(FLASH_TARGET_CONFIG_HEADER NXP/LPC546XX)
elseif("EFM32GG11_STK3701" IN_LIST MBED_TARGET_LABELS)
elseif(TARGET mbed-efm32gg11-stk3701)
set(FLASH_TARGET_CONFIG_HEADER SiliconLabs/EFM32GG11_STK3701)
endif()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ target_sources(mbed-ev-cog-ad3029lz
device/startup_ADuCM3029.c
)

target_link_libraries(mbed-ev-cog-ad3029lz INTERFACE mbed-aducm3029)
target_link_libraries(mbed-ev-cog-ad3029lz INTERFACE mbed-aducm3029 mbed-flash-cmsis-algo)
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ target_sources(mbed-ev-cog-ad4050lz
device/startup_ADuCM4050.c
)

target_link_libraries(mbed-ev-cog-ad4050lz INTERFACE mbed-aducm4050)
target_link_libraries(mbed-ev-cog-ad4050lz INTERFACE mbed-aducm4050 mbed-flash-cmsis-algo)
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ target_sources(mbed-kl46z

mbed_set_linker_script(mbed-kl46z ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_link_libraries(mbed-kl46z INTERFACE mbed-klxx)
target_link_libraries(mbed-kl46z INTERFACE mbed-klxx mbed-flash-cmsis-algo)
2 changes: 1 addition & 1 deletion targets/TARGET_NUVOTON/TARGET_M251/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ target_include_directories(mbed-m251
device/StdDriver/inc
)

target_link_libraries(mbed-m251 INTERFACE mbed-nuvoton)
target_link_libraries(mbed-m251 INTERFACE mbed-nuvoton mbed-flash-cmsis-algo)

mbed_set_linker_script(mbed-m251 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

Expand Down
2 changes: 1 addition & 1 deletion targets/TARGET_NUVOTON/TARGET_M261/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ target_include_directories(mbed-m261
device/StdDriver/inc
)

target_link_libraries(mbed-m261 INTERFACE mbed-nuvoton)
target_link_libraries(mbed-m261 INTERFACE mbed-nuvoton mbed-flash-cmsis-algo)

mbed_set_linker_script(mbed-m261 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

Expand Down
2 changes: 1 addition & 1 deletion targets/TARGET_NUVOTON/TARGET_M451/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ mbed_set_linker_script(mbed-m451 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

add_library(mbed-numaker-pfm-m453 INTERFACE)

target_link_libraries(mbed-numaker-pfm-m453 INTERFACE mbed-m451)
target_link_libraries(mbed-numaker-pfm-m453 INTERFACE mbed-m451 mbed-flash-cmsis-algo)
2 changes: 1 addition & 1 deletion targets/TARGET_NUVOTON/TARGET_M480/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ target_include_directories(mbed-m480
device/StdDriver/inc
)

target_link_libraries(mbed-m480 INTERFACE mbed-nuvoton)
target_link_libraries(mbed-m480 INTERFACE mbed-nuvoton mbed-flash-cmsis-algo)

mbed_set_linker_script(mbed-m480 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

Expand Down
2 changes: 1 addition & 1 deletion targets/TARGET_NUVOTON/TARGET_NUC472/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ target_link_libraries(mbed-nuc472 INTERFACE mbed-nuvoton)

add_library(mbed-numaker-pfm-nuc472 INTERFACE)

target_link_libraries(mbed-numaker-pfm-nuc472 INTERFACE mbed-nuc472 mbed-nu-xram-supported)
target_link_libraries(mbed-numaker-pfm-nuc472 INTERFACE mbed-nuc472 mbed-nu-xram-supported mbed-flash-cmsis-algo)