Преглед на файлове

Merge topic 'msvc-14.28'

c862e15418 Suppress MSVC 14.28 C5105 warning triggered by Windows SDK

Acked-by: Kitware Robot <[email protected]>
Merge-request: !5512
Brad King преди 5 години
родител
ревизия
5166915c07
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      CompileFlags.cmake

+ 6 - 0
CompileFlags.cmake

@@ -26,6 +26,12 @@ if(MSVC)
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stack:10000000")
 endif()
 
+# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it.
+if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 19.28)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd5105")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd5105")
+endif()
+
 if(_CLANG_MSVC_WINDOWS AND "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker -stack:20000000")
 endif()