Skip to content

Commit

Permalink
Fix Windows CI build.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pwnall committed Sep 1, 2021
1 parent d46cd17 commit 8954875
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8954875

Please sign in to comment.