diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ea3a38f5..028db6393 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,15 +229,17 @@ if(UNIX) endif() endif() -set(CXX_FEATURE_OVERRIDE OFF) +if(NOT MSVC) + set(CXX_FEATURE_OVERRIDE OFF) -if(_ICINGA2_CXX11) - include(CheckCXXSourceCompiles) - check_cxx_source_compiles("class Base { public: virtual void test(void) { } }; class Derived : public Base { virtual void test(void) override { } }; int main(){}" CXX_FEATURE_OVERRIDE) -endif() + if(_ICINGA2_CXX11) + include(CheckCXXSourceCompiles) + check_cxx_source_compiles("class Base { public: virtual void test(void) { } }; class Derived : public Base { virtual void test(void) override { } }; int main(){}" CXX_FEATURE_OVERRIDE) + endif() -if(NOT CXX_FEATURE_OVERRIDE) - add_definitions("-Doverride=") + if(NOT CXX_FEATURE_OVERRIDE) + add_definitions("-Doverride=") + endif() endif() configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ESCAPE_QUOTES)