Remove forcing Release build in CMake

Forcing the Release build type when `CMAKE_BUILD_TYPE` is undefined or set to 'None' is annoying for Arch package maintainers and general users who just want to provide their own compiler flags without CMake interfering.

https://wiki.archlinux.org/title/CMake_package_guidelines#CMake_can_automatically_override_the_default_compiler_optimization_flag
This commit is contained in:
Clownacy 2021-07-20 11:11:16 +01:00 committed by GitHub
parent 9b1c02fb4b
commit 568b4fd52c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,15 +35,6 @@ IF(UNIX AND NOT APPLE)
)
ENDIF(UNIX AND NOT APPLE)
# If no build type is set, default to "Release".
STRING(TOLOWER "${CMAKE_BUILD_TYPE}" TMP_BUILD_TYPE)
IF(TMP_BUILD_TYPE STREQUAL "")
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
ELSEIF(TMP_BUILD_TYPE MATCHES "none")
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
ENDIF()
UNSET(TMP_BUILD_TYPE)
# Put all the binaries and libraries into a single directory.
# NOTE: CACHE INTERNAL is required in order to get this to work
# for KF5 for some reason. (and maybe that's why KDE4 did this