From 8954875e065d5ee2eb420c919669c71a7abf6b50 Mon Sep 17 00:00:00 2001 From: Victor Costan Date: Tue, 22 Jun 2021 06:16:00 -0700 Subject: [PATCH] Fix Windows CI build. The Windows SDK versions present on our CI options (GitHub Actions hosted runners, AppVeyor) have headers that cause compilation warnings when included with MSVC operating in modern C modes (C11+). This PR disables the compilation warning caused by the Windows SDK headers, so we can get Windows feedback from CI. The warnings can be re-enabled when the Windows SDK used by our CI is upgraded to a version that doesn't trigger warnings. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6696453..8490728 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -362,6 +362,12 @@ if(CRC32C_BUILD_TESTS) # Warnings as errors in Visual Studio for this project's targets. if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set_property(TARGET crc32c_capi_tests APPEND PROPERTY COMPILE_OPTIONS "/WX") + + # The Windows SDK version currently on CI produces warnings when some + # headers are #included using C99 compatibity mode or above. This workaround + # can be removed once the Windows SDK on our CI is upgraded. + set_property(TARGET crc32c_capi_tests + APPEND PROPERTY COMPILE_OPTIONS "/wd5105") endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") add_test(NAME crc32c_capi_tests COMMAND crc32c_capi_tests)