Skip to content

Commit e270474

Browse files
committed
CMake: unit-tests: Move mbed-headers-platform to platform directory
Move the header-only mbed-headers-platform library the unit test stubs depend on into the platform component directory. This makes the platform stubs more self contained and improves composition of the library.
1 parent 40435fd commit e270474

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

UNITTESTS/stubs/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
add_library(mbed-stubs-headers INTERFACE)
55
add_library(mbed-headers INTERFACE)
66
add_library(mbed-headers-base INTERFACE)
7-
add_library(mbed-headers-platform INTERFACE)
87
add_library(mbed-headers-connectivity INTERFACE)
98
add_library(mbed-headers-events INTERFACE)
109

@@ -19,15 +18,6 @@ target_link_libraries(mbed-headers
1918
mbed-headers-rtos
2019
)
2120

22-
target_include_directories(mbed-headers-platform
23-
INTERFACE
24-
${mbed-os_SOURCE_DIR}/platform/include
25-
${mbed-os_SOURCE_DIR}/platform/include/platform
26-
${mbed-os_SOURCE_DIR}/platform/randlib/include/mbed-client-randlib/
27-
${mbed-os_SOURCE_DIR}/platform/randlib/include/
28-
${mbed-os_SOURCE_DIR}/platform/mbed-trace/include
29-
)
30-
3121
target_include_directories(mbed-headers-base
3222
INTERFACE
3323
${mbed-os_SOURCE_DIR}/UNITTESTS/target_h

platform/tests/UNITTESTS/doubles/CMakeLists.txt

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

4-
add_library(mbed-stubs-platform)
4+
add_library(mbed-headers-platform INTERFACE)
5+
target_include_directories(mbed-headers-platform
6+
INTERFACE
7+
${mbed-os_SOURCE_DIR}/platform/include
8+
${mbed-os_SOURCE_DIR}/platform/include/platform
9+
${mbed-os_SOURCE_DIR}/platform/randlib/include/mbed-client-randlib/
10+
${mbed-os_SOURCE_DIR}/platform/randlib/include/
11+
${mbed-os_SOURCE_DIR}/platform/mbed-trace/include
12+
)
513

14+
add_library(mbed-stubs-platform)
615
target_sources(mbed-stubs-platform
716
PRIVATE
817
mbed_critical_stub.c
@@ -17,12 +26,10 @@ target_sources(mbed-stubs-platform
1726
randLIB_stub.c
1827
randLIB_stub.cpp
1928
)
20-
2129
target_link_options(mbed-stubs-platform
2230
PRIVATE
2331
--coverage
2432
)
25-
2633
target_link_libraries(mbed-stubs-platform
2734
PRIVATE
2835
mbed-headers

0 commit comments

Comments
 (0)