From cb3febfd2ad519b065feffdde1404fd99ad47582 Mon Sep 17 00:00:00 2001 From: Julian Brost Date: Wed, 21 Oct 2020 12:49:50 +0200 Subject: [PATCH] Windows: require at least MSVC 19.20 to build Older versions of MSVC fail to rethrow an unhandled C++ exception (using `throw;`) in the termination handler (`std::set_terminate`), however Icinga relies on this behavior in its crash handler (`Application::ExceptionHandler`). --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 46e765415..3bb6e0536 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -378,6 +378,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() endif() +if(MSVC) + if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "19.20") + message(FATAL_ERROR "Your version of MSVC (${CMAKE_CXX_COMPILER_VERSION}) is too old for building Icinga 2 (MSVC >= 19.20 from Visual Studio 2019 is required).") + endif() +endif() + if(NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")