From dd6bdb505647861da88ea2b001d457127a62d4e6 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Fri, 26 Jun 2020 16:37:02 +0200 Subject: [PATCH] cmake: Add comment about mbedtls_test target Signed-off-by: Ronald Cron --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index af7400c9f..f7e2ed08b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,6 +238,20 @@ list(APPEND libs ${thirdparty_lib}) add_subdirectory(library) +# +# The C files in tests/src directory contain test code shared among test suites +# and programs. This shared test code is compiled and linked to test suites and +# programs objects as a set of compiled objects. The compiled objects are NOT +# built into a library that the test suite and program objects would link +# against as they link against the mbedcrypto, mbedx509 and mbedtls libraries. +# The reason is that such library is expected to have mutual dependencies with +# the aforementioned libraries and that there is as of today no portable way of +# handling such dependencies (only toolchain specific solutions). +# +# Thus the below definition of the `mbedtls_test` CMake library of objects +# target. This library of objects is used by tests and programs CMake files +# to define the test executables. +# if(ENABLE_TESTING OR ENABLE_PROGRAMS) file(GLOB MBEDTLS_TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tests/src/*.c) add_library(mbedtls_test OBJECT ${MBEDTLS_TEST_FILES})