Skip to content

Commit 6a5f3ae

Browse files
committed
CMake: Move rtos stubs sources to the mbed-os/rtos directory
Move the rtos stub library into the rtos component directory. so we can avoid duplicating the mbed-os source tree in a central UNITTESTS folder.
1 parent de7e326 commit 6a5f3ae

13 files changed

+17
-4
lines changed

UNITTESTS/stubs/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ add_subdirectory(connectivity)
123123
add_subdirectory(events)
124124
add_subdirectory(hal)
125125
add_subdirectory(platform)
126-
add_subdirectory(rtos)
127126
add_subdirectory(storage)
128127

129128
add_library(mbed-stubs INTERFACE)

rtos/CMakeLists.txt

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

4+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
5+
add_subdirectory(tests/UNITTESTS)
6+
endif()
7+
48
target_include_directories(mbed-core
59
INTERFACE
610
.

rtos/tests/.mbedignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UNITTESTS/*

rtos/tests/UNITTESTS/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(doubles)

UNITTESTS/stubs/rtos/CMakeLists.txt renamed to rtos/tests/UNITTESTS/doubles/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
add_library(mbed-stubs-rtos)
55

6+
add_definitions(-DUNITTEST)
7+
68
target_sources(mbed-stubs-rtos
79
PRIVATE
810
ConditionVariable_stub.cpp
@@ -16,7 +18,10 @@ target_sources(mbed-stubs-rtos
1618
)
1719

1820
target_link_libraries(mbed-stubs-rtos
19-
PRIVATE
20-
mbed-headers
21-
mbed-stubs-headers
21+
PRIVATE
22+
mbed-headers-base
23+
mbed-headers-rtos
24+
mbed-headers-platform
25+
mbed-headers-drivers
26+
mbed-headers-hal
2227
)

0 commit comments

Comments
 (0)