1 # Silence spurious -Wattribute warnings on GCC < 9.1: 2 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325 3 if (CMAKE_CXX_COMPILER_ID STREQUAL
"GNU" AND
4 CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1)
5 target_compile_options(paraviewbuild
7 "$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:C>:-Wno-attributes>>" 8 "$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:CXX>:-Wno-attributes>>")
11 # This module requires CMake 3.19 features (the `CheckCompilerFlag` 12 # module). Just skip it for older CMake versions. 13 if (CMAKE_VERSION VERSION_LESS
"3.19")
17 include(CheckCompilerFlag)
20 foreach (lang IN LISTS ARGN)
21 check_compiler_flag("${
lang}
" "${flag}
" "paraview_have_compiler_flag-${
lang}-${flag}
") 22 if (paraview_have_compiler_flag-${lang}-${flag}) 23 target_compile_options(paraviewbuild 25 "$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:${
lang}>:${flag}>>
") 30 option(PARAVIEW_ENABLE_EXTRA_BUILD_WARNINGS "Enable extra build warnings
" OFF) 31 mark_as_advanced(PARAVIEW_ENABLE_EXTRA_BUILD_WARNINGS) 33 if (PARAVIEW_ENABLE_EXTRA_BUILD_WARNINGS) 36 # Ignored warnings. Should be investigated and false positives reported to 37 # GCC and actual bugs fixed. 38 paraview_add_flag(-Wno-stringop-overflow ${langs}) # VTK issue 19306 39 paraview_add_flag(-Wno-stringop-overread ${langs}) # VTK issue 19307 40 paraview_add_flag(-Wno-vla-extension ${langs})
function paraview_add_flag(flag)