X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=cmake%2FQuasselCompileSettings.cmake;h=67cfd6433beb838ac97aca58b708cad2a2908a6b;hb=ce250a863bce3198096e65d4c7a68269495302dd;hp=68fccdc0d2fa01950a7d58d35553677ce94970c7;hpb=8a7444f4ed825b65acc874d9c2e8359f82523ac0;p=quassel.git diff --git a/cmake/QuasselCompileSettings.cmake b/cmake/QuasselCompileSettings.cmake index 68fccdc0..67cfd643 100644 --- a/cmake/QuasselCompileSettings.cmake +++ b/cmake/QuasselCompileSettings.cmake @@ -7,15 +7,6 @@ include(CheckCXXCompilerFlag) -if (CMAKE_CONFIGURATION_TYPES) - set(CMAKE_CONFIGURATION_TYPES Release RelWithDebInfo Debug Debugfull Profile) - set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "These are the configuration types we support" FORCE) -endif() - -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo Debug Debugfull Profile" FORCE) -endif() - # Qt debug flags set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUGFULL QT_DEBUG) @@ -66,12 +57,15 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-function -Wno-undef -fno-strict-aliasing") -# For MSVC, at least do a version sanity check +# For MSVC, at least do a version sanity check... elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0") message(FATAL_ERROR "Your compiler is too old; you need at least Visual Studio 2015 (MSVC 19.0+), GCC 4.8+, Clang 3.3+, or any other compiler with full C++11 support.") endif() + # ... and enable exception handling (required for STL types) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") + # Unknown/unsupported compiler else() message(WARNING "Unknown or unsupported compiler. Make sure to enable C++11 support. Good luck.")