Skip to content

Commit b20cea6

Browse files
authored
Guard adding intel compiler flag behind check for intel compiler. (#2004)
* Guard adding intel compiler flag behind check for intel compiler. For reasons I don't yet fully understand, failing to guard the check for flag -wd654 will cause it to be added to certain clang configurations, and then cause compilation to fail. While exactly why this happens needs investigation, the fix proposed in this patch seems direct and simple enough to apply regardless. * Update CMakeLists.txt Address review comments by reusing intel compiler block.
1 parent f30ba8b commit b20cea6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ else()
216216
# See #631 for rationale.
217217
add_cxx_compiler_flag(-wd1786)
218218
add_cxx_compiler_flag(-fno-finite-math-only)
219+
# ICC17u2: overloaded virtual function "benchmark::Fixture::SetUp" is only partially
220+
# overridden (because of deprecated overload)
221+
add_cxx_compiler_flag(-wd654)
219222
endif()
220223
# Disable deprecation warnings for release builds (when -Werror is enabled).
221224
if(BENCHMARK_ENABLE_WERROR)
@@ -230,9 +233,7 @@ else()
230233
add_cxx_compiler_flag(-Wstrict-aliasing)
231234
endif()
232235
endif()
233-
# ICC17u2: overloaded virtual function "benchmark::Fixture::SetUp" is only partially overridden
234-
# (because of deprecated overload)
235-
add_cxx_compiler_flag(-wd654)
236+
236237
add_cxx_compiler_flag(-Wthread-safety)
237238
if (HAVE_CXX_FLAG_WTHREAD_SAFETY)
238239
cxx_feature_check(THREAD_SAFETY_ATTRIBUTES "-DINCLUDE_DIRECTORIES=${PROJECT_SOURCE_DIR}/include")

0 commit comments

Comments
 (0)