From f56f06b65c532c5c4617d140c821889d3f502b79 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 25 Apr 2020 10:34:12 +0200 Subject: [PATCH] CMake: fix missing Coverage config in multi-config generators --- CMakeLists.txt | 1 - dtool/Config.cmake | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5f03be4d3..a31aea48cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,6 @@ endif() if(IS_MULTICONFIG) message(STATUS "Using multi-configuration generator") - set(CMAKE_CONFIGURATION_TYPES ${_configs}) else() # Set the default CMAKE_BUILD_TYPE before calling project(). if(NOT CMAKE_BUILD_TYPE) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 1b04a19936..1835ba6fd5 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -22,6 +22,17 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(IS_FREEBSD 1) endif() +# Define the type of build we are setting up. + +set(_configs Standard Release RelWithDebInfo Debug MinSizeRel) +if(DEFINED CMAKE_CXX_FLAGS_COVERAGE) + list(APPEND _configs Coverage) +endif() + +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES ${_configs}) +endif() + set(PER_CONFIG_OPTIONS) # Are we building with static or dynamic linking?