From 161908157d67ee8bcfa0c26917cccdc40e0c67ea Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Sat, 25 May 2019 12:13:06 -0600 Subject: [PATCH] CMake/MSVC: Mark headers in the libdir as system headers. This marks the headers in the LIBDIR as system headers and changes the warn to /W0 on msvc versions that support it. This resolves some warnings we would had to completely repress otherwise. --- build_files/cmake/platform/platform_win32.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index dce0e73cb37..f52a1f601dc 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -190,6 +190,12 @@ if(NOT EXISTS "${LIBDIR}/") message(FATAL_ERROR "Windows requires pre-compiled libs at: '${LIBDIR}'") endif() +# Mark libdir as system headers with a lower warn level, to resolve some warnings +# that we have very little control over +if(MSVC_VERSION GREATER_EQUAL 1914) + add_definitions(/experimental:external /external:templates- /external:I "${LIBDIR}" /external:W0) +endif() + # Add each of our libraries to our cmake_prefix_path so find_package() could work file(GLOB children RELATIVE ${LIBDIR} ${LIBDIR}/*) foreach(child ${children})