aboutsummaryrefslogtreecommitdiff
path: root/kde-modules/KDEFrameworkCompilerSettings.cmake
AgeCommit message (Collapse)Author
2022-01-20Only enable -bsymbolic-functions when Qt is built in a compatible wayVolker Krause
With Qt6 that isn't always the case, for example in our Linux CI image. Using -bsymbolic-function on the final executable in that case can result in function pointer conntect or method/signal lookups to fail. This can be observed in various unit test failures on the CI right now.
2021-07-16KDEFrameworksCompilerSettings: move backward-compat code into separate fileFriedrich W. H. Kossebau
Also add trigger to switch to KDE_COMPILERSETTINGS_LEVEL of latest KDECompilerSettings on ECM dependency in KF modules to 5.85 NO_CHANGELOG
2021-07-15KDEFrameworksCompilerSettings: remove hardcoded KDE_COMPILERSETTINGS_LEVELFriedrich W. H. Kossebau
No longer needed, also triggering wrong warning about KDE_COMPILERSETTINGS_LEVEL value for 3rd-party users requiring older ECM NO_CHANGELOG
2021-07-13KDEFrameworksCompilerSettings: guard ENABLE_BSYMBOLICFUNCTIONS by ECM versionFriedrich W. H. Kossebau
NO_CHANGELOG
2021-07-12Enable the usage of -Bsymbolic-functionsAleix Pol
Checks if the compiler supports it and if so it enables it by default. This is useful as it allows to perform internal linking operations at build time that otherwise would have been delayed until process startup time.
2021-07-10Revert "KDEFrameworksCompilerSettings: use latest KDECompilerSettings"Friedrich W. H. Kossebau
Has to wait until KF requires ECM 5.85.0 This reverts commit e6f87fa7427a2edde7dd8a47ace21011169d2650. NO_CHANGELOG
2021-07-10KDEFrameworksCompilerSettings: use latest KDECompilerSettingsFriedrich W. H. Kossebau
NO_CHANGELOG
2021-07-10KDECompilerSettings: add KDE_COMPILERSETTINGS_LEVEL & more settingsFriedrich W. H. Kossebau
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.
2021-06-27cmake: Explicetely disable c/c++ compiler extensionsAlbert Astals Cid
We're a multi-compiler project, so disable compiler specific extensions
2021-06-25KDEFrameworkCompilerSettings: add warning note to only use for KF modulesFriedrich W. H. Kossebau
NO_CHANGELOG
2021-06-19Set the C++17 standard starting from 5.84Ahmad Samir
2021-06-19Bump the C++ standard we compile with to 17Ahmad Samir
But only for repos that require Frameworks 5.83 or newer. We have asked on the KDE distributions mailing list and distro maintainers didn't object to the change (since most distros already have recent enough compilers).
2021-05-25Clean ECM files after the minimum version changeChristophe Giboudeaux
- Remove deprecated version checks - Use VERSION_GREATER_EQUAL
2021-04-23Modules docs: move rst docs into bracket commentsFriedrich W. H. Kossebau
CMake >= 3.0 supports bracket comments, and the reStructuredText integration code in sphinx/ext/ecm.py already supports extracting the docs from a bracket comment instead. Editing documentation without leading line comment markers is more simple, e,g. when reflowing text over lines. With ECM meanwhile requiring CMake 3.5 now it is possible to switch (and thus follow also the approach used by cmake itself). NO_CHANGELOG
2021-02-10Add clang-format target by default in KDEFrameworkCompilerSettingsAlexander Lohnau
To prevent cmake errors with exiting usages it is checked if the target already exists.
2021-01-31KDEFrameworksCompilerSettings: define -DQT_NO_KEYWORDS by defaultFriedrich W. H. Kossebau
2021-01-29Define -DQT_NO_FOREACH by defaultFriedrich W. H. Kossebau
2021-01-19Revert "Add clang-format target by default in KDEFrameworkCompilerSettings"Alexander Lohnau
This reverts commit a6be96a0c84b215de7f6fb397255af252adf7fc1.
2021-01-19Add clang-format target by default in KDEFrameworkCompilerSettingsAlexander Lohnau
To prevent cmake errors with exiting usages it is checked if the target already exists.
2020-06-14extra-cmake-modules: Convert to SPDX license statementsAndreas Cord-Landwehr
2019-11-03KDEFrameworkCompilerSettings: enable all Qt % KF deprecation warningsFriedrich W. H. Kossebau
Reviewers: #frameworks, #build_system, apol, dfaure Reviewed By: apol, dfaure Subscribers: dfaure, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D24990
2019-05-22Don't enable QT_STRICT_ITERATORS on Windows.David Faure
Summary: Strict iterators can't be used on Windows, they lead to a link error when application code iterates over a QVector<QPoint> for instance, unless Qt itself was also built with strict iterators. See example at https://bugreports.qt.io/browse/AUTOSUITE-946 Technically this would be fine for mingw, but not for MSVC neither clang-cl (which also uses the MSVC ABI). I think it's fine to just disable it for all Windows compilers, since any iterators misuse will be detected on Unix anyway. Test Plan: None, I'm relying on Volker's findings. Reviewers: vkrause, dvratil Reviewed By: dvratil Subscribers: apol, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D21314
2019-04-07Unconditionally enable -DQT_STRICT_ITERATORS, not just in debug modeDavid Faure
Summary: It turns out QT_STRICT_ITERATORS does not introduce any overhead (they are inlined so everything gets optimized), confirmed by Dan comparing the produced assembly in Compiler Explorer. Reviewers: dvratil, mlaurent, aacid Reviewed By: aacid Subscribers: aacid, kde-buildsystem, kde-frameworks-devel Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D20349
2019-01-19Move -Wsuggest-override -Wlogical-op to regular compiler settingsAlbert Astals Cid
Summary: They really help making the code better so it's good to have all applications getting those warnings Subscribers: apol, vkrause, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D18167
2018-12-21Revert "Clang: don't enable -Wzero-as-null-pointer-constant on 5.0.0"v5.54.0-rc1v5.54.0David Faure
This reverts commit e1adaa7ebab1b0de72c82d95bdf568e435713a4e. Version number confusion.
2018-12-20Clang: don't enable -Wzero-as-null-pointer-constant on 5.0.0David Faure
Summary: The clang compiler in Android NDK r15b, which has version 5.0.300080, warns as follows: warning: unknown warning option '-Wzero-as-null-pointer-constant'; did you mean '-Wint-to-void-pointer-cast'? [-Wunknown-warning-option] Test Plan: Removing the option removes the warning Reviewers: aacid, cgiboudeaux, apol Reviewed By: cgiboudeaux Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D17714
2018-11-12Use `MATCHES "Clang"` to detect clangRené J.V. Bertin
This is for compatibility with Apple's Xcode compilers which identify as AppleClang. Differential Revision: https://phabricator.kde.org/D16816
2018-09-22Add QT_NO_NARROWING_CONVERSIONS_IN_CONNECT as default compile flagsLaurent Montel
Summary: Use QT_NO_NARROWING_CONVERSIONS_IN_CONNECT as default flags Reviewers: dfaure Reviewed By: dfaure Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D15566
2018-06-29Drop outdated QT_USE_FAST_OPERATOR_PLUSFriedrich W. H. Kossebau
Summary: QT_USE_FAST_OPERATOR_PLUS has been deprecated in Qt 4.8, in favour of QT_USE_QSTRINGBUILDER. The latter also covers QByteArray. Qt5 headers still supports QT_USE_FAST_OPERATOR_PLUS (at least 5.11.1), as subset of QT_USE_QSTRINGBUILDER as it was introduced in Qt4.8, but not as documented build flag. Given QT_USE_QSTRINGBUILDER is set here and thus triggers anything that QT_USE_FAST_OPERATOR_PLUS would trigger in Qt code, removing it should clean up the macro from undocumented features and thus reduce confusion. No non-Qt is known at least in KDE repos which checks this build flag otherwise, so no regression should be expected here as well. Reviewers: vkrause Reviewed By: vkrause Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D13800
2018-06-29Add -Wlogical-op -Wzero-as-null-pointer-constant to KF5 warningsAlbert Astals Cid
Reviewers: cgiboudeaux, apol Reviewed By: cgiboudeaux, apol Subscribers: apol, kde-frameworks-devel, kde-buildsystem, cgiboudeaux, dhaumann Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D10166
2017-04-05Use -Wno-gnu-zero-variadic-macro-arguments moreKevin Funk
Summary: Add it to KDECompilerSettings.cmake instead of KDEFrameworkCompilerSettings.cmake. Users can then just enable -pedantic without worrying about the gnu-zero-variadic-macro-arguments warning. This fixes some warnings in e.g. kdenlive Reviewers: kossebau, apol, dfaure Reviewed By: apol Subscribers: apol, #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5302
2017-03-19KDE compiler settings: treat Clang and AppleClang equallyv5.33.0-rc1v5.33.0René J.V. Bertin
https://phabricator.kde.org/D5089
2017-01-23Enable -Wsuggest-override for g++ >= 5.0.0Albert Astals Cid
REVIEW: 129724
2017-01-03Revert "Enable -Wsuggest-override for g++ >= 5.0.0"Stephen Kelly
This reverts commit d1d637fadd6dad68995d44101250ebbc3307ed0b. This is far too noisy. The correct steps for this kind of change are: * Enable the warning locally * Take the action recommended by the warning in the code, and push the result * Push the warning on everyone to enforce that the code stays fixed for the future
2016-12-30Enable -Wsuggest-override for g++ >= 5.0.0Albert Astals Cid
REVIEW: 129724
2016-10-08Revert "Teach KDECompilerSettings about clang-cl, a mode of Clang compiler ↵Ben Cooksley
that simulates MSVC." This reverts commit 4b8e8dcc8856d8f438860783e7641d02d1c05630.
2016-09-30Teach KDECompilerSettings about clang-cl, a mode of Clang compiler that ↵Gleb Popov
simulates MSVC. REVIEW: 128779
2016-08-31add full license textAllen Winter
REVIEW: 128780
2015-12-28Silence CMP0063 warnings with KDECompilerSettings.Alex Merry
We recommend including KDE "settings" modules with NO_POLICY_SCOPE, both so we can resolve this issue and to allow us to deal with similar things in the future. REVIEW: 126535
2015-12-18Fix CMP0054 warningsKevin Funk
Example: CMake Warning (dev) at Z:/kderoot/share/ECM/kde-modules/KDEFrameworkCompilerSettings.cmake:50(elseif): Policy CMP0054 is not set: Only interpret if() arguments as variables or keywords when unquoted. Run "cmake --help-policy CMP0054" for policy details. Use the cmake_policy command to set the policy and suppress this warning. REVIEW: 126405
2015-09-10Disable -Wgnu-zero-variadic-macro-arguments when using clangAlex Richardson
This warning is emitted for every qCDebug() call and is not useful. REVIEW: 125031
2015-08-18Add -pedantic for KF5 code (when using gcc or clang)David Faure
REVIEW: 124763
2015-08-18KDEFrameworkCompilerSettings: only enable strict iterators in debug modeDavid Faure
(they are slower). And enable them on MSVC now that we rely on Qt 5.3, as the comment said. REVIEW: 124762
2015-02-06Document when modules were added to ECM.Alex Merry
2014-04-11Add documentation generation using SphinxAlex Merry
This is deliberately modelled very closely on CMake's documentation system. It's a hefty patch, because it involved changing all the documentation to be in reStructuredText format. I also cleaned up the copyright/license statements at the same time. Note that the find modules contain the full license, due to the fact that ecm_use_find_module() copies them out of the ECM distribution.
2014-02-14Improve docs for kde modulesAlex Merry
REVIEW: 115488
2014-01-23Only set QT_STRICT_ITERATORS when not compiling with MSVCAlex Richardson
On MSVC linker errors will happen when this flag is set (with Qt < 5.3) REVIEW: 115234
2014-01-14substitute QT_USE_FAST_CONCATENATION with QT_USE_QSTRINGBUILDERMichal Humpula
REVIEW: 115012
2013-12-14Split Frameworks only definitions to a new fileAlbert Astals Cid