summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2017-05-31 15:45:59 +0200
committerAnders Broman <a.broman58@gmail.com>2017-06-01 08:06:43 +0000
commit9719bac5ee8df89cefd4f750acdc5ef75cc75e63 (patch)
treecdbcb3aaf2ea2f31748f11408b873b637716a400 /CMakeLists.txt
parentdc7b9cdb41561d264647e73f4b0a05b8c48fb176 (diff)
downloadwireshark-9719bac5ee8df89cefd4f750acdc5ef75cc75e63.tar.gz
cmake: Add -Wshorten-64-to-32 for C++ when using Qt >= 5.9
The warnings has been fixed in Qt 5.9. Change-Id: I7cc71612e601517b7d7117c3cf2711ec983593a6 Reviewed-on: https://code.wireshark.org/review/21861 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 497f239675..a5a8ce9f93 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -430,8 +430,6 @@ else()
-Wlogical-op
-Wjump-misses-init
-Wunused-const-variable
- # The Qt headers generate a ton of shortening errors on 64-bit systems
- # so only enable this for C for now.
-Wshorten-64-to-32
#
@@ -445,6 +443,15 @@ else()
set(CXX_WARN_FLAGS
)
+ find_package(Qt5Core) # Needed to check for Qt version
+ if (Qt5Core_VERSION VERSION_GREATER 5.8)
+ # The Qt headers in version 5.8 and older generate a ton of shortening
+ # errors on 64-bit systems so only enable this for version 5.9 and greater.
+ set(CXX_WARN_FLAGS ${CXX_WARN_FLAGS}
+ -Wshorten-64-to-32
+ )
+ endif()
+
set(COMMON_EXTRA_WARN_FLAGS
# The following are for C and C++
-Wpedantic