CMake: fix missing Coverage config in multi-config generators

This commit is contained in:
rdb 2020-04-25 10:34:12 +02:00
parent 00305bccae
commit f56f06b65c
2 changed files with 11 additions and 1 deletions

View File

@ -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)

View File

@ -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?