From 169393e6ae4cc329afb42d073ce7f5058c17f0e6 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Mon, 7 Oct 2024 12:34:42 +0200 Subject: [PATCH] Restrict the definition of memcheck/lcov targets Restrict the definition of memcheck/lcov targets to the case where Mbed TLS/TF-PSA-Crypto is the main project. To avoid conflict between the targets when the integration of the TF-PSA-Crypto build system into the Mbed TLS one is completed. Signed-off-by: Ronald Cron --- CMakeLists.txt | 5 ++--- tf-psa-crypto/TF-PSA-Crypto.cmake | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86b0ffa414..aef67471f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -473,8 +473,7 @@ if(ENABLE_TESTING) add_subdirectory(tests) # additional convenience targets for Unix only - if(UNIX) - + if(UNIX AND (NOT MBEDTLS_AS_SUBPROJECT)) # For coverage testing: # 1. Build with: # cmake -D CMAKE_BUILD_TYPE=Coverage /path/to/source && make @@ -493,7 +492,7 @@ if(ENABLE_TESTING) COMMAND rm -f memcheck.log COMMAND mv DartConfiguration.tcl.bak DartConfiguration.tcl ) - endif(UNIX) + endif() # Make scripts needed for testing available in an out-of-source build. if (NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/tf-psa-crypto/TF-PSA-Crypto.cmake b/tf-psa-crypto/TF-PSA-Crypto.cmake index 986d3fd2d7..142a9d3548 100644 --- a/tf-psa-crypto/TF-PSA-Crypto.cmake +++ b/tf-psa-crypto/TF-PSA-Crypto.cmake @@ -406,7 +406,7 @@ if(ENABLE_TESTING) add_subdirectory(tests) # additional convenience targets for Unix only - if(UNIX) + if(UNIX AND (NOT TF_PSA_CRYPTO_AS_SUBPROJECT)) # For coverage testing: # 1. Build with: # cmake -D CMAKE_BUILD_TYPE=Coverage /path/to/source && make @@ -425,7 +425,7 @@ if(ENABLE_TESTING) COMMAND rm -f memcheck.log COMMAND mv DartConfiguration.tcl.bak DartConfiguration.tcl ) - endif(UNIX) + endif() # Make scripts needed for testing available in an out-of-source build. if (NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})