Skip to content

Commit ed28be4

Browse files
committed
CMake: Fix build failure due to CMSIS restructure
1 parent 32d9225 commit ed28be4

File tree

13 files changed

+65
-58
lines changed

13 files changed

+65
-58
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
mbed_add_cmake_directory_if_labels("TARGET")
5+
6+
add_subdirectory(RTOS2)

rtos/source/TARGET_CORTEX/rtx5/RTX/CMakeLists.txt renamed to cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt

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

4-
function(_mbed_get_rtx_assembly toolchain_dir)
4+
function(_mbed_get_cortex_m_exception_handlers toolchain_dir)
55
foreach(key ${MBED_TARGET_LABELS})
66
if(${key} STREQUAL CORTEX_A)
77
set(STARTUP_RTX_FILE TARGET_CORTEX_A/irq_ca.S)
@@ -26,36 +26,38 @@ function(_mbed_get_rtx_assembly toolchain_dir)
2626
endforeach()
2727
endfunction()
2828

29-
function(_mbed_add_cortexa_handler_if)
29+
function(_mbed_get_cortex_a_exception_handlers)
3030
foreach(key ${MBED_TARGET_LABELS})
3131
if(${key} STREQUAL CORTEX_A)
3232
target_sources(mbed-os PRIVATE Config/TARGET_CORTEX_A/handlers.c)
3333
endif()
3434
endforeach()
3535
endfunction()
3636

37-
# Add Cortex A handlers if needed
38-
_mbed_add_cortexa_handler_if()
37+
_mbed_get_cortex_a_exception_handlers()
3938

4039
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
41-
_mbed_get_rtx_assembly(TOOLCHAIN_GCC)
40+
_mbed_get_cortex_m_exception_handlers(TOOLCHAIN_GCC)
4241
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
43-
_mbed_get_rtx_assembly(TOOLCHAIN_ARM)
42+
_mbed_get_cortex_m_exception_handlers(TOOLCHAIN_ARM)
4443
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
45-
_mbed_get_rtx_assembly(TOOLCHAIN_IAR)
44+
_mbed_get_cortex_m_exception_handlers(TOOLCHAIN_IAR)
4645
endif()
4746

4847
target_include_directories(mbed-os
4948
PUBLIC
5049
Config
5150
Include
51+
Include1
5252
Source
5353
)
5454

5555
target_sources(mbed-os
5656
PRIVATE
5757
Config/RTX_Config.c
5858

59+
Library/cmsis_os1.c
60+
5961
Source/rtx_delay.c
6062
Source/rtx_evflags.c
6163
Source/rtx_evr.c
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
target_sources(mbed-os
5-
PRIVATE
6-
mbed_tz_context.c
7-
)
8-
94
target_include_directories(mbed-os
105
PUBLIC
11-
${CMAKE_CURRENT_SOURCE_DIR}
6+
Include
7+
)
8+
9+
target_sources(mbed-os
10+
PRIVATE
11+
Source/irq_ctrl_gic.c
1212
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
target_include_directories(mbed-os
5+
PUBLIC
6+
Include
7+
)
8+
9+
target_sources(mbed-os
10+
PRIVATE
11+
Source/mbed_tz_context.c
12+
)
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
mbed_add_cmake_directory_if_labels("TARGET")
4+
add_subdirectory(CMSIS)

cmsis/CMakeLists.txt

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

3-
mbed_add_cmake_directory_if_labels("TARGET")
4-
5-
target_sources(mbed-os
6-
PRIVATE
7-
RTE_Components.h
8-
)
9-
10-
target_include_directories(mbed-os
11-
PUBLIC
12-
${CMAKE_CURRENT_SOURCE_DIR}
13-
)
4+
add_subdirectory(CMSIS_5)
5+
add_subdirectory(device)

cmsis/TARGET_CORTEX_A/CMakeLists.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.

cmsis/device/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(RTE)
5+
add_subdirectory(rtos)
6+
7+
target_include_directories(mbed-os
8+
PUBLIC
9+
.
10+
)
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
mbed_add_cmake_directory_if_labels("TARGET")
4+
target_include_directories(mbed-os
5+
PUBLIC
6+
include
7+
)

rtos/source/TARGET_CORTEX/CMakeLists.txt renamed to cmsis/device/rtos/CMakeLists.txt

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

4-
target_sources(mbed-os PRIVATE
5-
mbed_boot.c
6-
mbed_rtos_rtx.c
7-
mbed_rtx_handlers.c
8-
mbed_rtx_idle.cpp
9-
)
10-
11-
add_subdirectory(rtx5)
12-
134
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
145
target_sources(mbed-os
156
PRIVATE
@@ -29,6 +20,12 @@ endif()
2920

3021
target_include_directories(mbed-os
3122
PUBLIC
32-
${CMAKE_CURRENT_SOURCE_DIR}
33-
rtx4
23+
include
24+
)
25+
26+
target_sources(mbed-os PRIVATE
27+
source/mbed_boot.c
28+
source/mbed_rtos_rtx.c
29+
source/mbed_rtx_handlers.c
30+
source/mbed_rtx_idle.cpp
3431
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
function(_mbed_get_system_init)
5+
if(${MBED_TOOLCHAIN} STREQUAL "IAR")
6+
target_sources(mbed-os PRIVATE TOOLCHAIN_IAR/cmain.S)
7+
endif()
8+
endfunction()
9+
10+
_mbed_get_system_init()

rtos/CMakeLists.txt

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

4-
add_subdirectory(source/TARGET_CORTEX)
5-
64
target_include_directories(mbed-os
75
PUBLIC
86
${CMAKE_CURRENT_SOURCE_DIR}

0 commit comments

Comments
 (0)