Skip to content

KDECompilerSettings: add KDE_COMPILERSETTINGS_LEVEL & more settings

Please see the examples in the new doc for the intended usage patterns. Better ideas and proposals welcome, but so far seems those who looked at it are not too unhappy with that. At least when sticking with the current approach applying-by-include, which is a different topic ;)

There is desire for having more strict compiler settings by default over what the KDECompilerSettings have been declaring until now. This means making more use of modern features usually and being less tolerant about the use of deprecated ones.

While some projects have used KDEFrameworksCompilerSettings to get more modern requirements by just a single macro include, that was not the intent of that module, and now is also warned about in the docs.

Instead of adding a new separate dedicated module e.g. named KDEStricterCompilerSettings, with a separate version scheme for sets of strict settings, the existing KDECompilerSettings macro file is instead extended as well as are the ECM versions reused to define the different sets of settings. As these settings are getting more strict by the time, e.g. allowing less of old & deprecated code, these sets are considered as kind of levels.

To enable the clients to control the required settings level, a dedicated variable KDE_COMPILERSETTINGS_LEVEL is introduced, which for convenience defaults to the minimum required ECM version, so only needs to be set when the need for other newer features provided by ECM does not go along the settings level of that ECM version.

As some projects might have needs not exactly matching a certain settings level, additionally the settings can be optionally individually controlled by specific variables, to be set again before including KDECompilerSettings.

Initial patch uses set(KDE_COMPILERSETTINGS_LEVEL 5.84.0) for KDEFrameworksCompilerSettings, to be prepared for the short transfer time when all the KF modules get the min ECM bumped to ECM 5.85.0, only after which it will be possible to use the new KDECompilerSettings settings.

!153 (merged) would then be used to switch KDEFrameworksCompilerSettings in a controlled manner to rely on latest KDECompilerSettings.

@dfaure @nicolasfella @ahmadsamir @vkrause @aacid @mlaurent @cgiboudeaux

Edited by Friedrich W. H. Kossebau

Merge request reports