瀏覽代碼

Intel compiler: silence noisy warning for incorrectly evaluated inlining

Chuck Atkins 5 年之前
父節點
當前提交
10c48c980f
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      cmake/CMakeLists.txt

+ 8 - 0
cmake/CMakeLists.txt

@@ -28,6 +28,14 @@ else()
   set(CMAKE_CXX_EXTENSIONS OFF)
 endif()
 
+# The Intel compiler isn't able to deal with noinline member functions of
+# template classses defined in headers.  As such it spams the output with
+#   warning #2196: routine is both "inline" and "noinline"
+# This silences that warning.
+if (CMAKE_CXX_COMPILER_ID MATCHES Intel)
+  string(APPEND CMAKE_CXX_FLAGS " -diag-disable=2196")
+endif()
+
 # Options
 option(protobuf_BUILD_TESTS "Build tests" ON)
 option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF)