diff --git a/CMakeLists.txt b/CMakeLists.txt index 86b0ffa41..aef67471f 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 986d3fd2d..142a9d354 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})