mirror of
https://github.com/gabime/spdlog.git
synced 2025-11-16 09:28:56 +08:00
set CMAKE_BUILD_TYPE only in top-level project (#3480)
This commit is contained in:
@@ -19,8 +19,12 @@ include(GNUInstallDirs)
|
||||
# Set default build to release
|
||||
# ---------------------------------------------------------------------------------------
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
# Set CMAKE_BUILD_TYPE only if this project is top-level
|
||||
if((DEFINED PROJECT_IS_TOP_LEVEL AND PROJECT_IS_TOP_LEVEL)
|
||||
OR (NOT DEFINED PROJECT_IS_TOP_LEVEL AND CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR))
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ---------------------------------------------------------------------------------------
|
||||
# Compiler config
|
||||
|
||||
Reference in New Issue
Block a user