KF5 modules development branches now build in C++17 mode (but keep public headers compatible)

Friedrich W. H. Kossebau kossebau at kde.org
Sun Jun 20 11:16:33 BST 2021


Hi,

small heads-up for everyone: as of yesterday, KDEFrameworksCompilerSettings 
from current ECM development branch now sets
    set(CMAKE_CXX_STANDARD 17)
    set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
for all KF modules (triggered by required ECM 5.84.0 version, which was also 
bumped yesterday in all KF module development branches already to activate the 
setting).
Any custom CMAKE_CXX_STANDARD settings as before present in some KF modules 
have been removed as well, so all KF modules code should build now complying 
to the C++17 standards, so everyone can also take advantage of those in new 
code for KF modules from now on.


BEWARE (just to emphasize the obvious to you, so it can be referenced ;) ):

As KF5 promises ABI & source backwards-compatibility for the KF5 series to its 
consumers, public KF headers need to stay compatible with projects using C++11 
(or C++14).
So in public headers C++17 features can only be used for new API and also 
needs to be guarded properly by respective preprocessor macros to not be seen 
in C++<17 usages of KF headers.

Cheers
Friedrich




More information about the Kde-frameworks-devel mailing list