From 007461dec54bff8b044ecfc110b91c2abe879ae7 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Mon, 24 Aug 2020 21:28:44 +0200 Subject: [PATCH] Require C++17 As discussed in https://mail.kde.org/pipermail/plasma-devel/2020-August/118263.html we agreed that requiring C++17 in Plasma is fine. There's no code that actually uses C++17 features yet, but specifying the requirement anyway has advantages. 1) It documents the policy in a much more discoverable place than a wiki page or similar could do 2) Building in 17 mode allows the compiler to do some stuff implicitly, like guranteed copy elision --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cfdc1567..4553e9c87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,10 @@ set(PROJECT_VERSION_MAJOR 5) set(QT_MIN_VERSION "5.14.0") set(KF5_MIN_VERSION "5.72.0") set(INSTALL_SDDM_THEME TRUE) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Svg Widgets Quick QuickWidgets Concurrent Test Network) find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})