Răsfoiți Sursa

CompileFlags: Tell PGI compiler not to issue warning diagnostics

When hosting CMake's own build with the PGI compiler there are several
warnings that cannot easily be fixed or suppressed.  We have enough code
quality tools and warnings from other compilers that it is unlikely a
PGI-only warning is useful.
Brad King 9 ani în urmă
părinte
comite
f416285631
1 a modificat fișierele cu 7 adăugiri și 0 ștergeri
  1. 7 0
      CompileFlags.cmake

+ 7 - 0
CompileFlags.cmake

@@ -71,6 +71,13 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
   endif()
   endif()
 endif()
 endif()
 
 
+foreach(lang C CXX)
+  # Suppress warnings from PGI compiler.
+  if (CMAKE_${lang}_COMPILER_ID STREQUAL "PGI")
+    set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w")
+  endif()
+endforeach()
+
 # use the ansi CXX compile flag for building cmake
 # use the ansi CXX compile flag for building cmake
 if (CMAKE_ANSI_CXXFLAGS)
 if (CMAKE_ANSI_CXXFLAGS)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")