Skip to content

Commit d0c4468

Browse files
authored
Merge pull request #14827 from ARMmbed/move_hal_stubs
Move hal stubs to hal directory
2 parents b5c2f70 + 26c608b commit d0c4468

File tree

8 files changed

+20
-14
lines changed

8 files changed

+20
-14
lines changed

UNITTESTS/stubs/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ add_library(mbed-headers-base INTERFACE)
77
add_library(mbed-headers-platform INTERFACE)
88
add_library(mbed-headers-connectivity INTERFACE)
99
add_library(mbed-headers-storage INTERFACE)
10-
add_library(mbed-headers-hal INTERFACE)
1110
add_library(mbed-headers-events INTERFACE)
1211

1312
target_link_libraries(mbed-headers
@@ -89,12 +88,6 @@ target_include_directories(mbed-headers-events
8988
${mbed-os_SOURCE_DIR}/events/include/events/internal
9089
)
9190

92-
target_include_directories(mbed-headers-hal
93-
INTERFACE
94-
${mbed-os_SOURCE_DIR}/hal
95-
${mbed-os_SOURCE_DIR}/hal/include
96-
)
97-
9891
target_include_directories(mbed-headers
9992
INTERFACE
10093
${mbed-os_SOURCE_DIR}/features
@@ -109,7 +102,6 @@ target_include_directories(mbed-stubs-headers
109102

110103
add_subdirectory(connectivity)
111104
add_subdirectory(events)
112-
add_subdirectory(hal)
113105
add_subdirectory(platform)
114106
add_subdirectory(storage)
115107

hal/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Copyright (c) 2020-2021 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
add_subdirectory(TARGET_FLASH_CMSIS_ALGO EXCLUDE_FROM_ALL)
59

610
add_subdirectory(usb)

hal/tests/.mbedignore

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

hal/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/hal/CMakeLists.txt renamed to hal/tests/UNITTESTS/doubles/CMakeLists.txt

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

4+
add_library(mbed-headers-hal INTERFACE)
5+
6+
target_include_directories(mbed-headers-hal
7+
INTERFACE
8+
${mbed-os_SOURCE_DIR}/hal
9+
${mbed-os_SOURCE_DIR}/hal/include
10+
)
11+
412
add_library(mbed-stubs-hal)
513

614
target_compile_definitions(mbed-stubs-hal
@@ -17,13 +25,10 @@ target_sources(mbed-stubs-hal
1725
watchdog_api_stub.c
1826
)
1927

20-
target_link_options(mbed-stubs-hal
21-
PRIVATE
22-
--coverage
23-
)
24-
2528
target_link_libraries(mbed-stubs-hal
2629
PRIVATE
27-
mbed-headers
30+
mbed-headers-base
31+
mbed-headers-hal
32+
mbed-headers-platform
2833
mbed-stubs-headers
2934
)

0 commit comments

Comments
 (0)