diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27e1c1b..02efbf6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,8 +33,13 @@ jobs: build-and-test-windows: #if: false # Temporarily disable - name: Build And Test Windows - runs-on: windows-latest + name: Build And Test Windows ${{ matrix.os-version }} ${{ matrix.crypto }} + runs-on: windows-${{ matrix.os-version }} + strategy: + fail-fast: false + matrix: + os-version: [2019, 2022] + crypto: [OpenSSL, BCrypt] env: VCPKG_ROOT: ${{ github.workspace }}/vcpkg steps: @@ -65,7 +70,7 @@ jobs: run: | mkdir build cd build - cmake -S .. -G Ninja -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_TOOLS=ON -DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake + cmake -S .. -G Ninja -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_TOOLS=ON -DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake -DUSE_CRYPTO=${{matrix.crypto}} shell: cmd # Mark all directories as safe so checkouts performed in CMakeLists.txt don't cause "unsafe repository" errors. diff --git a/CMakeLists.txt b/CMakeLists.txt index 61f3159..d1489cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,15 +84,17 @@ if (WIN32) string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - # - # Check whether BCrypt can be used with this SDK version - # - cmake_push_check_state() - set(CMAKE_REQUIRED_LIBRARIES bcrypt) - check_symbol_exists(BCryptEncrypt windows.h BCRYPT_AVAILABLE) - cmake_pop_check_state() - if (NOT BCRYPT_AVAILABLE AND USE_CRYPTO STREQUAL "BCrypt") - message(FATAL_ERROR "You're on Windows but BCrypt seems to be unavailable, you will need OpenSSL") + if (USE_CRYPTO STREQUAL "BCrypt") + # + # Check whether BCrypt can be used with this SDK version + # + cmake_push_check_state() + set(CMAKE_REQUIRED_LIBRARIES bcrypt) + check_symbol_exists(BCryptEncrypt windows.h BCRYPT_AVAILABLE) + cmake_pop_check_state() + if (NOT BCRYPT_AVAILABLE) + message(FATAL_ERROR "You're on Windows but BCrypt seems to be unavailable, you will need OpenSSL") + endif() endif() endif()