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
pull/14426/head
Rajkumar Kanagaraj 2021-04-07 09:58:32 -07:00
parent d9db59f38c
commit ba04c1cf76
9 changed files with 36 additions and 0 deletions

View File

@ -1,6 +1,10 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
if(NOT ${CMAKE_CROSSCOMPILING})
add_subdirectory(tests/UNITTESTS)
endif()
add_subdirectory(source/framework) add_subdirectory(source/framework)
target_include_directories(mbed-cellular target_include_directories(mbed-cellular

View File

@ -1,6 +1,10 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
if(NOT ${CMAKE_CROSSCOMPILING})
add_subdirectory(tests/UNITTESTS)
endif()
add_subdirectory(lorastack) add_subdirectory(lorastack)
add_subdirectory(system) add_subdirectory(system)

View File

@ -1,6 +1,10 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
if(NOT ${CMAKE_CROSSCOMPILING})
add_subdirectory(tests/UNITTESTS)
endif()
# TODO CMake: Perhaps move this/these file(s) into connectivity/drivers/cellular # TODO CMake: Perhaps move this/these file(s) into connectivity/drivers/cellular
target_sources(mbed-cellular target_sources(mbed-cellular
INTERFACE INTERFACE

View File

@ -1,6 +1,10 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
if(NOT ${CMAKE_CROSSCOMPILING})
add_subdirectory(tests/UNITTESTS)
endif()
target_include_directories(mbed-core target_include_directories(mbed-core
INTERFACE INTERFACE
. .

View File

@ -1,6 +1,10 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
if(NOT ${CMAKE_CROSSCOMPILING})
add_subdirectory(tests/UNITTESTS)
endif()
add_library(mbed-events INTERFACE) add_library(mbed-events INTERFACE)
target_include_directories(mbed-events target_include_directories(mbed-events

View File

@ -1,6 +1,10 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
if(NOT ${CMAKE_CROSSCOMPILING})
add_subdirectory(tests/UNITTESTS)
endif()
# List of all optional platform libraries available. # List of all optional platform libraries available.
add_library(mbed-psa INTERFACE) add_library(mbed-psa INTERFACE)

View File

@ -1,6 +1,10 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
if(NOT ${CMAKE_CROSSCOMPILING})
add_subdirectory(tests/UNITTESTS)
endif()
if("DATAFLASH" IN_LIST MBED_TARGET_LABELS) if("DATAFLASH" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(COMPONENT_DATAFLASH) add_subdirectory(COMPONENT_DATAFLASH)
endif() endif()

View File

@ -1,6 +1,10 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
if(NOT ${CMAKE_CROSSCOMPILING})
add_subdirectory(tests/UNITTESTS)
endif()
target_include_directories(mbed-storage-filesystemstore target_include_directories(mbed-storage-filesystemstore
INTERFACE INTERFACE
. .

View File

@ -1,6 +1,10 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
if(NOT ${CMAKE_CROSSCOMPILING})
add_subdirectory(tests/UNITTESTS)
endif()
target_include_directories(mbed-storage-tdbstore target_include_directories(mbed-storage-tdbstore
INTERFACE INTERFACE
. .