]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
CMake: Set default build type to RelWithDebInfo
authorVitaly Chikunov <vt@altlinux.org>
Wed, 15 Dec 2021 00:46:26 +0000 (03:46 +0300)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Wed, 15 Dec 2021 14:11:18 +0000 (17:11 +0300)
To maintain backward compatibility for users already familiar with older engine
build type (basically restores `-O2 -g').

Fixes: 5ad6c77 ("Adapt C flags for the cmake build type")
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
CMakeLists.txt

index c31469176a5b8365e8501b5dadd8266670e67b19..8461be8a2dbe0aeb215254e1cc17fedd13e21820 100644 (file)
@@ -10,6 +10,11 @@ enable_testing()
 
 find_package(OpenSSL 3.0 REQUIRED)
 
+if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+  message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
+  set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build." FORCE)
+endif()
+
 if (NOT DEFINED OPENSSL_ROOT_DIR)
   get_filename_component(OPENSSL_ROOT_DIR ${OPENSSL_INCLUDE_DIR} DIRECTORY)
   message(STATUS "Setting OpenSSL root: ${OPENSSL_ROOT_DIR}")