mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
CMake: Fix CMAKE_CONFIGURATION_TYPES not including Coverage
Coverage is added based on the value of CMAKE_CXX_COMPILER_ID, which isn't known until after the project() call. This fixes a regression in f26f7d22260b85ea4d0d6044dc2c410ad1da8a20
This commit is contained in:
parent
131ae98bfd
commit
4747e6e4df
@ -32,24 +32,16 @@ a CMake < 3.9. Making a guess if this is a multi-config generator.")
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Define the type of build we are setting up.
|
# Set the default CMAKE_BUILD_TYPE before calling project().
|
||||||
set(_configs Standard Release RelWithDebInfo Debug MinSizeRel)
|
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "(AppleClang|Clang|GCC)")
|
|
||||||
list(APPEND _configs Coverage)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(IS_MULTICONFIG)
|
if(IS_MULTICONFIG)
|
||||||
message(STATUS "Using multi-configuration generator")
|
message(STATUS "Using multi-configuration generator")
|
||||||
set(CMAKE_CONFIGURATION_TYPES "${_configs}" CACHE STRING "")
|
|
||||||
else()
|
else()
|
||||||
# Set the default CMAKE_BUILD_TYPE before calling project().
|
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE Standard CACHE STRING "Choose the type of build." FORCE)
|
set(CMAKE_BUILD_TYPE Standard CACHE STRING "Choose the type of build." FORCE)
|
||||||
message(STATUS "Using default build type ${CMAKE_BUILD_TYPE}")
|
message(STATUS "Using default build type ${CMAKE_BUILD_TYPE}")
|
||||||
else()
|
else()
|
||||||
message(STATUS "Using build type ${CMAKE_BUILD_TYPE}")
|
message(STATUS "Using build type ${CMAKE_BUILD_TYPE}")
|
||||||
endif()
|
endif()
|
||||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${_configs})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set defaults for macOS, must be before project().
|
# Set defaults for macOS, must be before project().
|
||||||
@ -76,6 +68,20 @@ project(Panda3D VERSION ${_version})
|
|||||||
unset(_version)
|
unset(_version)
|
||||||
unset(_s)
|
unset(_s)
|
||||||
|
|
||||||
|
# Determine the possible build types. Must be *after* calling project().
|
||||||
|
set(_configs Standard Release RelWithDebInfo Debug MinSizeRel)
|
||||||
|
if(CMAKE_CXX_COMPILER_ID MATCHES "(AppleClang|Clang|GCC)")
|
||||||
|
list(APPEND _configs Coverage)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message("available configs are ${_configs}")
|
||||||
|
|
||||||
|
if(IS_MULTICONFIG)
|
||||||
|
set(CMAKE_CONFIGURATION_TYPES "${_configs}" CACHE STRING "" FORCE)
|
||||||
|
else()
|
||||||
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${_configs})
|
||||||
|
endif()
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
string(REPLACE "$(EFFECTIVE_PLATFORM_NAME)" "" PANDA_CFG_INTDIR "${CMAKE_CFG_INTDIR}")
|
string(REPLACE "$(EFFECTIVE_PLATFORM_NAME)" "" PANDA_CFG_INTDIR "${CMAKE_CFG_INTDIR}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user