aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorFederico Ficarelli <federico.ficarelli@gmail.com>2018-07-09 12:45:10 +0200
committerDominic Hamon <dominichamon@users.noreply.github.com>2018-07-09 11:45:10 +0100
commit0c21bc369aa157c10e63f4e392fd19768ac7e05b (patch)
treea2ea6839720f0fdfbb38c90aec86718f9636e035 /CMakeLists.txt
parent5946795e82f778fff891c37f56c0d7a76a118bf9 (diff)
downloadgoogle-benchmark-0c21bc369aa157c10e63f4e392fd19768ac7e05b.tar.gz
Fix build with Intel compiler (#631)
* Set -Wno-deprecated-declarations for Intel Intel compiler silently ignores -Wno-deprecated-declarations so warning no. 1786 must be explicitly suppressed. * Make std::int64_t → double casts explicit While std::int64_t → double is a perfectly conformant implicit conversion, Intel compiler warns about it. Make them explicit via static_cast<double>. * Make std::int64_t → int casts explicit Intel compiler warns about emplacing an std::int64_t into an int container. Just make the conversion explicit via static_cast<int>. * Cleanup Intel -Wno-deprecated-declarations workaround logic
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c7fe7a8..8ddacab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -142,6 +142,12 @@ else()
# Disable warnings regarding deprecated parts of the library while building
# and testing those parts of the library.
add_cxx_compiler_flag(-Wno-deprecated-declarations)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ # Intel silently ignores '-Wno-deprecated-declarations',
+ # warning no. 1786 must be explicitly disabled.
+ # See #631 for rationale.
+ add_cxx_compiler_flag(-wd1786)
+ endif()
# Disable deprecation warnings for release builds (when -Werror is enabled).
add_cxx_compiler_flag(-Wno-deprecated RELEASE)
add_cxx_compiler_flag(-Wno-deprecated RELWITHDEBINFO)