mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 21:21:37 +00:00
fix(cmake): respect multi-config generators
- Set a default CMAKE_BUILD_TYPE only for single-config generators - Stop overriding CMAKE_CONFIGURATION_TYPES - Do not require CMAKE_BUILD_TYPE when generating the package config Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,10 +13,12 @@ include(GNUInstallDirs)
|
||||
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
|
||||
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)
|
||||
|
||||
# Set a default build type
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
# Set a default build type (multi-config generators select it at build time)
|
||||
get_property(_is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(NOT _is_multi_config AND NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo)
|
||||
endif()
|
||||
unset(_is_multi_config)
|
||||
|
||||
set(PROJECT_MIN_CXX_STANDARD 17)
|
||||
|
||||
@@ -111,7 +113,6 @@ if(_sanitizers)
|
||||
endif()
|
||||
|
||||
# Configure build types
|
||||
set(CMAKE_CONFIGURATION_TYPES "Debug" "Release" "RelWithDebInfo")
|
||||
set(_warnings "-Wshadow -Wall -Wextra -Wpedantic")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g ${_warnings} ${_sanitizers}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
||||
|
||||
Reference in New Issue
Block a user