Skip to content

Commit 3bb8de6

Browse files
authored
Merge pull request #14308 from hugueskamba/hk_cmake_create_flash_cmsis_algo
Create FLASH CMSIS ALGO target to remove dependency on MBED_TARGET_LABELS
2 parents 29cfcd6 + c45e6ce commit 3bb8de6

File tree

11 files changed

+21
-21
lines changed

11 files changed

+21
-21
lines changed

hal/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# Copyright (c) 2020 ARM Limited. All rights reserved.
1+
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if("FLASH_CMSIS_ALGO" IN_LIST MBED_TARGET_LABELS)
5-
add_subdirectory(TARGET_FLASH_CMSIS_ALGO)
6-
endif()
4+
add_subdirectory(TARGET_FLASH_CMSIS_ALGO EXCLUDE_FROM_ALL)
75

86
add_subdirectory(usb)
97

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
# Copyright (c) 2020 ARM Limited. All rights reserved.
1+
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
target_include_directories(mbed-core
4+
add_library(mbed-flash-cmsis-algo INTERFACE)
5+
6+
target_include_directories(mbed-flash-cmsis-algo
57
INTERFACE
68
.
79
)
810

9-
target_sources(mbed-core
11+
target_sources(mbed-flash-cmsis-algo
1012
INTERFACE
1113
flash_common_algo.c
1214
)

hal/tests/TESTS/mbed_hal/qspi/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020 ARM Limited. All rights reserved.
1+
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

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

1111
project(${TEST_TARGET})
1212

13-
if("EP_AGORA" IN_LIST MBED_TARGET_LABELS)
13+
if(TARGET mbed-ep-agora)
1414
set(FLASH_TARGET_CONFIG_HEADER NORDIC/EP_AGORA)
15-
elseif("NRF52840_DK" IN_LIST MBED_TARGET_LABELS)
15+
elseif(TARGET mbed-nrf52840-dk)
1616
set(FLASH_TARGET_CONFIG_HEADER NORDIC/NRF52840_DK)
17-
elseif("K82F" IN_LIST MBED_TARGET_LABELS)
17+
elseif(TARGET mbed-k82f)
1818
set(FLASH_TARGET_CONFIG_HEADER NXP/K82F)
19-
elseif("LPC546XX" IN_LIST MBED_TARGET_LABELS)
19+
elseif(TARGET mbed-lpc546xx)
2020
set(FLASH_TARGET_CONFIG_HEADER NXP/LPC546XX)
21-
elseif("EFM32GG11_STK3701" IN_LIST MBED_TARGET_LABELS)
21+
elseif(TARGET mbed-efm32gg11-stk3701)
2222
set(FLASH_TARGET_CONFIG_HEADER SiliconLabs/EFM32GG11_STK3701)
2323
endif()
2424

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/TARGET_EV_COG_AD3029LZ/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ target_sources(mbed-ev-cog-ad3029lz
1515
device/startup_ADuCM3029.c
1616
)
1717

18-
target_link_libraries(mbed-ev-cog-ad3029lz INTERFACE mbed-aducm3029)
18+
target_link_libraries(mbed-ev-cog-ad3029lz INTERFACE mbed-aducm3029 mbed-flash-cmsis-algo)

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/TARGET_EV_COG_AD4050LZ/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ target_sources(mbed-ev-cog-ad4050lz
1515
device/startup_ADuCM4050.c
1616
)
1717

18-
target_link_libraries(mbed-ev-cog-ad4050lz INTERFACE mbed-aducm4050)
18+
target_link_libraries(mbed-ev-cog-ad4050lz INTERFACE mbed-aducm4050 mbed-flash-cmsis-algo)

targets/TARGET_Freescale/TARGET_KLXX/TARGET_KL46Z/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ target_sources(mbed-kl46z
3232

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

35-
target_link_libraries(mbed-kl46z INTERFACE mbed-klxx)
35+
target_link_libraries(mbed-kl46z INTERFACE mbed-klxx mbed-flash-cmsis-algo)

targets/TARGET_NUVOTON/TARGET_M251/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ target_include_directories(mbed-m251
7070
device/StdDriver/inc
7171
)
7272

73-
target_link_libraries(mbed-m251 INTERFACE mbed-nuvoton)
73+
target_link_libraries(mbed-m251 INTERFACE mbed-nuvoton mbed-flash-cmsis-algo)
7474

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

targets/TARGET_NUVOTON/TARGET_M261/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ target_include_directories(mbed-m261
8282
device/StdDriver/inc
8383
)
8484

85-
target_link_libraries(mbed-m261 INTERFACE mbed-nuvoton)
85+
target_link_libraries(mbed-m261 INTERFACE mbed-nuvoton mbed-flash-cmsis-algo)
8686

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

targets/TARGET_NUVOTON/TARGET_M451/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ mbed_set_linker_script(mbed-m451 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
7575

7676
add_library(mbed-numaker-pfm-m453 INTERFACE)
7777

78-
target_link_libraries(mbed-numaker-pfm-m453 INTERFACE mbed-m451)
78+
target_link_libraries(mbed-numaker-pfm-m453 INTERFACE mbed-m451 mbed-flash-cmsis-algo)

targets/TARGET_NUVOTON/TARGET_M480/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ target_include_directories(mbed-m480
8686
device/StdDriver/inc
8787
)
8888

89-
target_link_libraries(mbed-m480 INTERFACE mbed-nuvoton)
89+
target_link_libraries(mbed-m480 INTERFACE mbed-nuvoton mbed-flash-cmsis-algo)
9090

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

targets/TARGET_NUVOTON/TARGET_NUC472/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ target_link_libraries(mbed-nuc472 INTERFACE mbed-nuvoton)
9494

9595
add_library(mbed-numaker-pfm-nuc472 INTERFACE)
9696

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

0 commit comments

Comments
 (0)