From fdf337965c1f712fb08bf87d5e184ac6c68f120a Mon Sep 17 00:00:00 2001 From: Peter Toft Date: Wed, 14 Oct 2020 17:19:02 +0200 Subject: [PATCH] Add fix for cmake control of CMAKE_BUILD_TYPE only if mbedtls is the root project Signed-off-by: Peter Toft --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5af4c8124..27590ef08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,9 +112,12 @@ option: \n\ endif() endif() -set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} - CACHE STRING "Choose the type of build: None Debug Release Coverage ASan ASanDbg MemSan MemSanDbg Check CheckFull" - FORCE) +# If this is the root project add longer list of available CMAKE_BUILD_TYPE values +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} + CACHE STRING "Choose the type of build: None Debug Release Coverage ASan ASanDbg MemSan MemSanDbg Check CheckFull" + FORCE) +endif() # Create a symbolic link from ${base_name} in the binary directory # to the corresponding path in the source directory.