Skip to content

Commit f628ede

Browse files
committed
CMake: Add add_subdirectory of unittests
- add every libraries unittest directory into respective CMake which allows to include unittest source into build based on MBED_BUILD_UNITTESTS flag
1 parent 2afdf35 commit f628ede

File tree

9 files changed

+36
-0
lines changed

9 files changed

+36
-0
lines changed

connectivity/cellular/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(${MBED_BUILD_UNITTESTS})
5+
add_subdirectory(tests/UNITTESTS)
6+
endif()
7+
48
add_subdirectory(source/framework)
59

610
target_include_directories(mbed-cellular

connectivity/lorawan/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(${MBED_BUILD_UNITTESTS})
5+
add_subdirectory(tests/UNITTESTS)
6+
endif()
7+
48
add_subdirectory(lorastack)
59
add_subdirectory(system)
610

connectivity/netsocket/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(${MBED_BUILD_UNITTESTS})
5+
add_subdirectory(tests/UNITTESTS)
6+
endif()
7+
48
# TODO CMake: Perhaps move this/these file(s) into connectivity/drivers/cellular
59
target_sources(mbed-cellular
610
INTERFACE

drivers/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(${MBED_BUILD_UNITTESTS})
5+
add_subdirectory(tests/UNITTESTS)
6+
endif()
7+
48
target_include_directories(mbed-core
59
INTERFACE
610
.

events/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(${MBED_BUILD_UNITTESTS})
5+
add_subdirectory(tests/UNITTESTS)
6+
endif()
7+
48
add_library(mbed-events INTERFACE)
59

610
target_include_directories(mbed-events

platform/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(${MBED_BUILD_UNITTESTS})
5+
add_subdirectory(tests/UNITTESTS)
6+
endif()
7+
48
# List of all optional platform libraries available.
59
add_library(mbed-psa INTERFACE)
610

storage/blockdevice/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(${MBED_BUILD_UNITTESTS})
5+
add_subdirectory(tests/UNITTESTS)
6+
endif()
7+
48
if("DATAFLASH" IN_LIST MBED_TARGET_LABELS)
59
add_subdirectory(COMPONENT_DATAFLASH)
610
endif()

storage/kvstore/filesystemstore/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(${MBED_BUILD_UNITTESTS})
5+
add_subdirectory(tests/UNITTESTS)
6+
endif()
7+
48
target_include_directories(mbed-storage-filesystemstore
59
INTERFACE
610
.

storage/kvstore/tdbstore/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(${MBED_BUILD_UNITTESTS})
5+
add_subdirectory(tests/UNITTESTS)
6+
endif()
7+
48
target_include_directories(mbed-storage-tdbstore
59
INTERFACE
610
.

0 commit comments

Comments
 (0)