diff --git a/CMakeLists.txt b/CMakeLists.txt index 561498c5d4..7f31c61758 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,7 +150,7 @@ set(THREADS_PREFER_PTHREAD_FLAG TRUE) find_package(Threads) # If this is the root project add longer list of available CMAKE_BUILD_TYPE values -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) +if(NOT MBEDTLS_AS_SUBPROJECT) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build: None Debug Release Coverage ASan ASanDbg MemSan MemSanDbg Check CheckFull TSan TSanDbg" FORCE) diff --git a/tf-psa-crypto/TF-PSA-Crypto.cmake b/tf-psa-crypto/TF-PSA-Crypto.cmake index e520ad15be..1ccb87cf6a 100644 --- a/tf-psa-crypto/TF-PSA-Crypto.cmake +++ b/tf-psa-crypto/TF-PSA-Crypto.cmake @@ -101,7 +101,7 @@ set(THREADS_PREFER_PTHREAD_FLAG TRUE) find_package(Threads) # If this is the root project add longer list of available CMAKE_BUILD_TYPE values -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) +if(NOT TF_PSA_CRYPTO_AS_SUBPROJECT) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build: None Debug Release Coverage ASan ASanDbg MemSan MemSanDbg Check CheckFull TSan TSanDbg" FORCE)