Set CMAKE_BUILD_TYPE only for single-config generators (#2839)

Thanks @moritz-h
This commit is contained in:
moritz-h 2023-08-02 16:22:20 +02:00 committed by GitHub
parent 2ee8bac78e
commit 371bc8ebe2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ include(GNUInstallDirs)
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------
# Set default build to release # Set default build to release
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE)
endif() endif()