diff --git a/CMakeLists.txt b/CMakeLists.txt
index effdfff2e..a35d91aaa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,8 @@
cmake_minimum_required(VERSION 2.8.8)
set(BOOST_MIN_VERSION "1.66.0")
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(icinga2)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@@ -383,8 +385,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
OUTPUT_VARIABLE _ICINGA2_COMPILER_VERSION
)
- if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.7.0")
- message(FATAL_ERROR "Your version of GCC (${CMAKE_CXX_COMPILER_VERSION}) is too old for building Icinga 2 (GCC >= 4.7.0 is required).")
+ if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "6.3.0")
+ message(FATAL_ERROR "Your version of GCC (${CMAKE_CXX_COMPILER_VERSION}) is too old for building Icinga 2 (GCC >= 6.3.0 is required).")
endif()
endif()
@@ -395,8 +397,6 @@ if(MSVC)
endif()
if(NOT MSVC)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
-
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)
if(NOT CXX_FEATURE_OVERRIDE)
diff --git a/doc/21-development.md b/doc/21-development.md
index 9abb95ad5..822743811 100644
--- a/doc/21-development.md
+++ b/doc/21-development.md
@@ -697,7 +697,7 @@ Read more about it in the [Technical Concepts](19-technical-concepts.md#technica
#### Get to know the code
-First off, you really need to know C++ and portions of C++11 and the boost libraries.
+First off, you really need to know C++ and portions of C++14 and the boost libraries.
Best is to start with a book or online tutorial to get into the basics.
Icinga developers gained their knowledge through studies, training and self-teaching
code by trying it out and asking senior developers for guidance.
@@ -1138,7 +1138,7 @@ for formatting, splitting strings, joining arrays into strings, etc.
Use the existing libraries and header-only includes
for this specific version.
-Note: Prefer C++11 features where possible, e.g. std::atomic and lambda functions.
+Note: Prefer C++14 features where possible, e.g. std::atomic and lambda functions.
General:
@@ -1185,7 +1185,7 @@ If you consider an external library or code to be included with Icinga, the foll
requirements must be fulfilled:
- License is compatible with GPLv2+. Boost license, MIT works, Apache is not.
-- C++11 is supported, C++14 or later doesn't work
+- C++14 is supported
- Header only implementations are preferred, external libraries require packages on every distribution.
- No additional frameworks, Boost is the only allowed.
- The code is proven to be robust and the GitHub repository is alive, or has 1k+ stars. Good libraries also provide a user list, if e.g. Ceph is using it, this is a good candidate.
@@ -1365,13 +1365,13 @@ are best effort and sometimes out-of-date. Git Master may contain updates.
#### CentOS 7
```bash
-yum -y install gdb vim git bash-completion htop
+yum -y install gdb vim git bash-completion htop centos-release-scl
yum -y install rpmdevtools ccache \
- cmake make gcc-c++ flex bison \
+ cmake make devtoolset-11-gcc-c++ flex bison \
openssl-devel boost169-devel systemd-devel \
mysql-devel postgresql-devel libedit-devel \
- libstdc++-devel
+ devtoolset-11-libstdc++-devel
groupadd icinga
groupadd icingacmd
@@ -1412,8 +1412,8 @@ Fourth, depending on your likings, you may add a bash alias for building,
or invoke the commands inside:
```bash
-alias i2_debug="cd /root/icinga2; mkdir -p debug; cd debug; cmake $I2_DEBUG ..; make -j2; sudo make -j2 install; cd .."
-alias i2_release="cd /root/icinga2; mkdir -p release; cd release; cmake $I2_RELEASE ..; make -j2; sudo make -j2 install; cd .."
+alias i2_debug="cd /root/icinga2; mkdir -p debug; cd debug; scl enable devtoolset-11 -- cmake $I2_DEBUG ..; make -j2; sudo make -j2 install; cd .."
+alias i2_release="cd /root/icinga2; mkdir -p release; cd release; scl enable devtoolset-11 -- cmake $I2_RELEASE ..; make -j2; sudo make -j2 install; cd .."
```
This is taken from the [centos7-dev](https://github.com/Icinga/icinga-vagrant/tree/master/centos7-dev) Vagrant box.
@@ -2172,8 +2172,8 @@ Icinga application using a dist tarball (including notes for distributions):
* cmake >= 2.6
* GNU make (make) or ninja-build
-* C++ compiler which supports C++11
- * RHEL/Fedora/SUSE: gcc-c++ >= 4.7 (extra Developer Tools on RHEL5/6 see below)
+* C++ compiler which supports C++14
+ * RHEL/Fedora/SUSE: gcc-c++ >= 6.3 (extra Developer Tools on RHEL7 see below)
* Debian/Ubuntu: build-essential
* Alpine: build-base
* you can also use clang++
@@ -2442,33 +2442,18 @@ The following packages are required to build the SELinux policy module:
* selinux-policy (selinux-policy on CentOS 6, selinux-policy-devel on CentOS 7)
* selinux-policy-doc
-##### RHEL/CentOS 6
+##### RHEL/CentOS 7
The RedHat Developer Toolset is required for building Icinga 2 beforehand.
-This contains a modern version of flex and a C++ compiler which supports
-C++11 features.
+This contains a C++ compiler which supports C++14 features.
```bash
-cat >/etc/yum.repos.d/devtools-2.repo <$HOME/.rpmmacros <