Skip to content
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

CMake: Create CMSIS library targets to remove dependency on MBED_TARGET_LABELS #14306

Merged
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
10 changes: 3 additions & 7 deletions cmsis/CMSIS_5/CMSIS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if("CORTEX_A" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_CORTEX_A)
elseif("CORTEX_M" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_CORTEX_M)
endif()

add_subdirectory(TARGET_CORTEX_A EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_CORTEX_M EXCLUDE_FROM_ALL)
8 changes: 5 additions & 3 deletions cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_A/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-cmsis-cortex-a INTERFACE)

target_include_directories(mbed-cmsis-cortex-a
INTERFACE
Include
)

target_sources(mbed-core
target_sources(mbed-cmsis-cortex-a
INTERFACE
Source/irq_ctrl_gic.c
)
8 changes: 5 additions & 3 deletions cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_M/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-cmsis-cortex-m INTERFACE)

target_include_directories(mbed-cmsis-cortex-m
INTERFACE
Include
)

target_sources(mbed-core
target_sources(mbed-cmsis-cortex-m
INTERFACE
Source/mbed_tz_context.c
)
4 changes: 3 additions & 1 deletion targets/TARGET_ARM_FM/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

add_library(mbed-arm-fm INTERFACE)
Expand All @@ -9,3 +9,5 @@ target_include_directories(mbed-arm-fm
INTERFACE
.
)

target_link_libraries(mbed-arm-fm INTERFACE mbed-cmsis-cortex-m)
4 changes: 3 additions & 1 deletion targets/TARGET_ARM_SSG/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

add_library(mbed-arm-ssg INTERFACE)
Expand All @@ -12,3 +12,5 @@ target_include_directories(mbed-arm-ssg
INTERFACE
.
)

target_link_libraries(mbed-arm-ssg INTERFACE mbed-cmsis-cortex-m)
2 changes: 2 additions & 0 deletions targets/TARGET_Ambiq_Micro/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ target_sources(mbed-ambiq-micro
sdk/utils/am_util_string.c
sdk/utils/am_util_time.c
)

target_link_libraries(mbed-ambiq-micro INTERFACE mbed-cmsis-cortex-m)
2 changes: 2 additions & 0 deletions targets/TARGET_Analog_Devices/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ target_include_directories(mbed-analog-devices
INTERFACE
.
)

target_link_libraries(mbed-analog-devices INTERFACE mbed-cmsis-cortex-m)
2 changes: 2 additions & 0 deletions targets/TARGET_Cypress/TARGET_PSOC6/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ target_sources(mbed-psoc6
${ASSEMBLY_ROUTINES}
)

target_link_libraries(mbed-psoc6 INTERFACE mbed-cmsis-cortex-m)

# TODO: Include only if mbed-baremetal is not used
if("CY_RTOS_AWARE" IN_LIST MBED_CONFIG_DEFINITIONS)
target_link_libraries(mbed-psoc6 INTERFACE mbed-cy-rtos mbed-cy-rtx)
Expand Down
2 changes: 2 additions & 0 deletions targets/TARGET_Freescale/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ target_sources(mbed-freescale
INTERFACE
USBPhy_Kinetis.cpp
)

target_link_libraries(mbed-freescale INTERFACE mbed-cmsis-cortex-m)
4 changes: 3 additions & 1 deletion targets/TARGET_GigaDevice/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

add_subdirectory(TARGET_GD32F30X EXCLUDE_FROM_ALL)
Expand All @@ -10,3 +10,5 @@ target_include_directories(mbed-gigadevice
INTERFACE
.
)

target_link_libraries(mbed-gigadevice INTERFACE mbed-cmsis-cortex-m)
4 changes: 3 additions & 1 deletion targets/TARGET_Maxim/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


Expand All @@ -17,3 +17,5 @@ target_sources(mbed-maxim
INTERFACE
USBPhy_Maxim.cpp
)

target_link_libraries(mbed-maxim INTERFACE mbed-cmsis-cortex-m)
2 changes: 2 additions & 0 deletions targets/TARGET_NORDIC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ target_include_directories(mbed-nordic
INTERFACE
.
)

target_link_libraries(mbed-nordic INTERFACE mbed-cmsis-cortex-m)
2 changes: 2 additions & 0 deletions targets/TARGET_NXP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ target_sources(mbed-nxp
INTERFACE
USBHAL_LPC17.cpp
)

target_link_libraries(mbed-nxp INTERFACE mbed-cmsis-cortex-m)
4 changes: 3 additions & 1 deletion targets/TARGET_RENESAS/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

add_subdirectory(TARGET_RZ_A1XX EXCLUDE_FROM_ALL)
Expand All @@ -10,3 +10,5 @@ target_include_directories(mbed-renesas
INTERFACE
.
)

target_link_libraries(mbed-renesas INTERFACE mbed-cmsis-cortex-a)
4 changes: 3 additions & 1 deletion targets/TARGET_STM/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

add_subdirectory(TARGET_STM32F0 EXCLUDE_FROM_ALL)
Expand Down Expand Up @@ -51,3 +51,5 @@ target_sources(mbed-stm
us_ticker.c
watchdog_api.c
)

target_link_libraries(mbed-stm INTERFACE mbed-cmsis-cortex-m)
4 changes: 3 additions & 1 deletion targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/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

if(${MBED_TOOLCHAIN} STREQUAL "ARM")
Expand Down Expand Up @@ -44,3 +44,5 @@ target_sources(mbed-s1sbp6a
)

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

target_link_libraries(mbed-s1sbp6a INTERFACE mbed-cmsis-cortex-m)
4 changes: 2 additions & 2 deletions targets/TARGET_Samsung/TARGET_SIDK_S5JS100/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

if(${MBED_TOOLCHAIN} STREQUAL "ARM")
Expand Down Expand Up @@ -64,4 +64,4 @@ target_sources(mbed-s5js100

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

target_link_libraries(mbed-s5js100)
target_link_libraries(mbed-s5js100 INTERFACE mbed-cmsis-cortex-m)
2 changes: 2 additions & 0 deletions targets/TARGET_Silicon_Labs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ target_include_directories(mbed-silicon-labs
INTERFACE
.
)

target_link_libraries(mbed-silicon-labs INTERFACE mbed-cmsis-cortex-m)
2 changes: 2 additions & 0 deletions targets/TARGET_TOSHIBA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ target_include_directories(mbed-toshiba
INTERFACE
.
)

target_link_libraries(mbed-toshiba INTERFACE mbed-cmsis-cortex-m)