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.
      |  ^~~~~
This commit is contained in:
Biswapriyo Nath 2024-09-19 19:25:49 +00:00
parent 272aa68d9b
commit 5b47c968ea

View file

@ -11,6 +11,10 @@ project(kdeconnect VERSION ${RELEASE_SERVICE_VERSION})
set(KF_MIN_VERSION "5.240") set(KF_MIN_VERSION "5.240")
set(QT_MIN_VERSION "6.7.0") 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) find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)