Merge pull request #14306 from hugueskamba/hk_cmake_create_cmsis_cortex_libs

CMake: Create CMSIS library targets to remove dependency on MBED_TARGET_LABELS
pull/14299/head
Martin Kojtal 2021-02-23 08:36:49 +00:00 committed by GitHub
commit 88a242f749
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 52 additions and 22 deletions

View File

@ -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)

View File

@ -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
)

View File

@ -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
)

View File

@ -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)
@ -9,3 +9,5 @@ target_include_directories(mbed-arm-fm
INTERFACE
.
)
target_link_libraries(mbed-arm-fm INTERFACE mbed-cmsis-cortex-m)

View File

@ -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)
@ -12,3 +12,5 @@ target_include_directories(mbed-arm-ssg
INTERFACE
.
)
target_link_libraries(mbed-arm-ssg INTERFACE mbed-cmsis-cortex-m)

View File

@ -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)

View File

@ -10,3 +10,5 @@ target_include_directories(mbed-analog-devices
INTERFACE
.
)
target_link_libraries(mbed-analog-devices INTERFACE mbed-cmsis-cortex-m)

View File

@ -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)

View File

@ -15,3 +15,5 @@ target_sources(mbed-freescale
INTERFACE
USBPhy_Kinetis.cpp
)
target_link_libraries(mbed-freescale INTERFACE mbed-cmsis-cortex-m)

View File

@ -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)
@ -10,3 +10,5 @@ target_include_directories(mbed-gigadevice
INTERFACE
.
)
target_link_libraries(mbed-gigadevice INTERFACE mbed-cmsis-cortex-m)

View File

@ -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
@ -17,3 +17,5 @@ target_sources(mbed-maxim
INTERFACE
USBPhy_Maxim.cpp
)
target_link_libraries(mbed-maxim INTERFACE mbed-cmsis-cortex-m)

View File

@ -9,3 +9,5 @@ target_include_directories(mbed-nordic
INTERFACE
.
)
target_link_libraries(mbed-nordic INTERFACE mbed-cmsis-cortex-m)

View File

@ -16,3 +16,5 @@ target_sources(mbed-nxp
INTERFACE
USBHAL_LPC17.cpp
)
target_link_libraries(mbed-nxp INTERFACE mbed-cmsis-cortex-m)

View File

@ -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)
@ -10,3 +10,5 @@ target_include_directories(mbed-renesas
INTERFACE
.
)
target_link_libraries(mbed-renesas INTERFACE mbed-cmsis-cortex-a)

View File

@ -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)
@ -51,3 +51,5 @@ target_sources(mbed-stm
us_ticker.c
watchdog_api.c
)
target_link_libraries(mbed-stm INTERFACE mbed-cmsis-cortex-m)

View File

@ -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")
@ -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)

View File

@ -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")
@ -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)

View File

@ -10,3 +10,5 @@ target_include_directories(mbed-silicon-labs
INTERFACE
.
)
target_link_libraries(mbed-silicon-labs INTERFACE mbed-cmsis-cortex-m)

View File

@ -10,3 +10,5 @@ target_include_directories(mbed-toshiba
INTERFACE
.
)
target_link_libraries(mbed-toshiba INTERFACE mbed-cmsis-cortex-m)