aboutsummaryrefslogtreecommitdiff
path: root/kde-modules
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2021-07-10 12:09:24 +0200
committerFriedrich W. H. Kossebau <kossebau@kde.org>2021-07-10 12:10:21 +0200
commit2cdf59e8ccb1fb11633324a4a2804503eec11de3 (patch)
treee7b16eac7f38eb16020b8119c5fd345631e10e84 /kde-modules
parente6f87fa7427a2edde7dd8a47ace21011169d2650 (diff)
downloadextra-cmake-modules-2cdf59e8ccb1fb11633324a4a2804503eec11de3.tar.gz
extra-cmake-modules-2cdf59e8ccb1fb11633324a4a2804503eec11de3.tar.bz2
Revert "KDEFrameworksCompilerSettings: use latest KDECompilerSettings"
Has to wait until KF requires ECM 5.85.0 This reverts commit e6f87fa7427a2edde7dd8a47ace21011169d2650. NO_CHANGELOG
Diffstat (limited to 'kde-modules')
-rw-r--r--kde-modules/KDEFrameworkCompilerSettings.cmake41
1 files changed, 37 insertions, 4 deletions
diff --git a/kde-modules/KDEFrameworkCompilerSettings.cmake b/kde-modules/KDEFrameworkCompilerSettings.cmake
index b53454d2..d7165f57 100644
--- a/kde-modules/KDEFrameworkCompilerSettings.cmake
+++ b/kde-modules/KDEFrameworkCompilerSettings.cmake
@@ -37,16 +37,33 @@ if (NOT CMAKE_CXX_STANDARD)
endif()
endif()
+set(KDE_COMPILERSETTINGS_LEVEL 5.84.0)
include(KDECompilerSettings NO_POLICY_SCOPE)
+add_definitions(-DQT_NO_CAST_TO_ASCII
+ -DQT_NO_CAST_FROM_ASCII
+ -DQT_NO_URL_CAST_FROM_STRING
+ -DQT_NO_CAST_FROM_BYTEARRAY
+ -DQT_USE_QSTRINGBUILDER
+ -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
+ )
+
+if (NOT WIN32)
+ # 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
+ add_definitions(-DQT_STRICT_ITERATORS)
+endif()
+
# Some non-KF projects make (ab)use of KDEFrameworkCompilerSettings currently,
-# let them only hit this when bumping their min. ECM requirement to a newer version.
-if (ECM_GLOBAL_FIND_VERSION VERSION_LESS 5.79.0)
- # added by KDECompilerSettings
- remove_definitions(
+# let them only hit this as well when bumping their min. ECM requirement to a newer version.
+if (ECM_GLOBAL_FIND_VERSION VERSION_GREATER_EQUAL 5.79.0)
+ add_definitions(
-DQT_NO_KEYWORDS
-DQT_NO_FOREACH
)
+else()
add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
endif()
@@ -55,6 +72,22 @@ add_definitions(
-DKF_DEPRECATED_WARNINGS_SINCE=0x060000
)
+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
+endif()
+
+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0.0)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wzero-as-null-pointer-constant" )
+ endif()
+endif()
+
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0.0)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wzero-as-null-pointer-constant" )
+ endif()
+endif()
+
if (ECM_GLOBAL_FIND_VERSION VERSION_GREATER_EQUAL 5.80.0)
include(KDEClangFormat)
# add clang-format target