Skip to content

Commit 2c34812

Browse files
committed
CMake: Create CMSIS library targets to remove dependency on MBED_TARGET_LABELS
This goes towards eventually removing reliance on targets.json to specify the requirements of Mbed targets.
1 parent 2660621 commit 2c34812

File tree

19 files changed

+52
-22
lines changed

19 files changed

+52
-22
lines changed

cmsis/CMSIS_5/CMSIS/CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
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("CORTEX_A" IN_LIST MBED_TARGET_LABELS)
5-
add_subdirectory(TARGET_CORTEX_A)
6-
elseif("CORTEX_M" IN_LIST MBED_TARGET_LABELS)
7-
add_subdirectory(TARGET_CORTEX_M)
8-
endif()
9-
4+
add_subdirectory(TARGET_CORTEX_A EXCLUDE_FROM_ALL)
5+
add_subdirectory(TARGET_CORTEX_M EXCLUDE_FROM_ALL)
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-cmsis-cortex-a INTERFACE)
5+
6+
target_include_directories(mbed-cmsis-cortex-a
57
INTERFACE
68
Include
79
)
810

9-
target_sources(mbed-core
11+
target_sources(mbed-cmsis-cortex-a
1012
INTERFACE
1113
Source/irq_ctrl_gic.c
1214
)
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-cmsis-cortex-m INTERFACE)
5+
6+
target_include_directories(mbed-cmsis-cortex-m
57
INTERFACE
68
Include
79
)
810

9-
target_sources(mbed-core
11+
target_sources(mbed-cmsis-cortex-m
1012
INTERFACE
1113
Source/mbed_tz_context.c
1214
)

targets/TARGET_ARM_FM/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
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
add_library(mbed-arm-fm INTERFACE)
@@ -9,3 +9,5 @@ target_include_directories(mbed-arm-fm
99
INTERFACE
1010
.
1111
)
12+
13+
target_link_libraries(mbed-arm-fm INTERFACE mbed-cmsis-cortex-m)

targets/TARGET_ARM_SSG/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
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
add_library(mbed-arm-ssg INTERFACE)
@@ -12,3 +12,5 @@ target_include_directories(mbed-arm-ssg
1212
INTERFACE
1313
.
1414
)
15+
16+
target_link_libraries(mbed-arm-ssg INTERFACE mbed-cmsis-cortex-m)

targets/TARGET_Ambiq_Micro/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ target_sources(mbed-ambiq-micro
2424
sdk/utils/am_util_string.c
2525
sdk/utils/am_util_time.c
2626
)
27+
28+
target_link_libraries(mbed-ambiq-micro INTERFACE mbed-cmsis-cortex-m)

targets/TARGET_Analog_Devices/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ target_include_directories(mbed-analog-devices
1010
INTERFACE
1111
.
1212
)
13+
14+
target_link_libraries(mbed-analog-devices INTERFACE mbed-cmsis-cortex-m)

targets/TARGET_Cypress/TARGET_PSOC6/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ target_sources(mbed-psoc6
280280
${ASSEMBLY_ROUTINES}
281281
)
282282

283+
target_link_libraries(mbed-psoc6 INTERFACE mbed-cmsis-cortex-m)
284+
283285
# TODO: Include only if mbed-baremetal is not used
284286
if("CY_RTOS_AWARE" IN_LIST MBED_CONFIG_DEFINITIONS)
285287
target_link_libraries(mbed-psoc6 INTERFACE mbed-cy-rtos mbed-cy-rtx)

targets/TARGET_Freescale/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ target_sources(mbed-freescale
1515
INTERFACE
1616
USBPhy_Kinetis.cpp
1717
)
18+
19+
target_link_libraries(mbed-freescale INTERFACE mbed-cmsis-cortex-m)

targets/TARGET_GigaDevice/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
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
add_subdirectory(TARGET_GD32F30X EXCLUDE_FROM_ALL)
@@ -10,3 +10,5 @@ target_include_directories(mbed-gigadevice
1010
INTERFACE
1111
.
1212
)
13+
14+
target_link_libraries(mbed-gigadevice INTERFACE mbed-cmsis-cortex-m)

0 commit comments

Comments
 (0)