(cmake): use "-isystem" style with visual studio for system headers
Description
Currently, using "badly" written system/dependency headers, displays many warnings that are not linked to our code on windows, making difficult to see our own errors. Since visual studio 2017 15.6, it is now possible to use a kind of "-isystem", like gcc/clang to tell to the compiler "no, i don't want to see bad code from others". It requires a little hack for now because CMake is not "aware" of this feature, but the added value should overcome the burden of 4 cmake lines:
if (MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /experimental:external /external:W0 ")
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "/external:I ")
endif()
Proposal
Put this 4 lines in our cmake, test, enjoy