From 125c54cdd79670c6a0b762d8534488a02383764e Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 27 Jul 2023 06:10:20 -0500 Subject: set default build type to 'Release' --- CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c5b880b..272cf6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,6 @@ +cmake_minimum_required (VERSION 3.20.0) if(MSVC) - cmake_minimum_required (VERSION 3.16.4) cmake_policy(SET CMP0091 NEW) -else() - cmake_minimum_required (VERSION 3.0) endif() project (LibreSSL C ASM) @@ -51,6 +49,17 @@ if(NOT LIBRESSL_SKIP_INSTALL) set( ENABLE_LIBRESSL_INSTALL ON ) endif(NOT LIBRESSL_SKIP_INSTALL) +# Set a default build type if none was specified +set(default_build_type "Release") + +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to '${default_build_type}' as none was specified.") + set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE + STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY + STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() set(BUILD_NC true) -- cgit v1.2.3-55-g6feb