From c862e154182ef60eb5e5d543de328f69873d9584 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 17 Nov 2020 11:41:52 -0500 Subject: Suppress MSVC 14.28 C5105 warning triggered by Windows SDK Issue: #21446 --- CompileFlags.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CompileFlags.cmake b/CompileFlags.cmake index 1c5f1be..e6fb20b 100644 --- a/CompileFlags.cmake +++ b/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() -- cgit v0.12