From 5b47c968ea14d9e093be73f81f3c3bef26370c3c Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Thu, 19 Sep 2024 19:25:49 +0000 Subject: [PATCH] CMake: Set required C++ standard to C++20 This fixes the following compiler error with winrt headers using mingw-w64 gcc toolchain. In file included from winrt/Windows.Foundation.h:12, from kdeconnect-kde/plugins/sendnotifications/windowsnotificationslistener.h:11, from kdeconnect-kde/plugins/sendnotifications/sendnotificationsplugin.cpp:12: winrt/base.h:89:2: error: #error C++/WinRT requires coroutine support, which is currently missing. Try enabling C++20 in your compiler. 89 | #error C++/WinRT requires coroutine support, which is currently missing. Try enabling C++20 in your compiler. | ^~~~~ --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f382f1ba..621c5482b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,10 @@ project(kdeconnect VERSION ${RELEASE_SERVICE_VERSION}) set(KF_MIN_VERSION "5.240") set(QT_MIN_VERSION "6.7.0") +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD_REQUIRED TRUE) + find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)