test multiple crypto libraries on multiple versions of windows

This commit is contained in:
Tomas Maly
2023-07-30 13:49:09 +02:00
committed by Fletcher Dunn
parent 6e7ec281b2
commit 6aa4e785c9
2 changed files with 19 additions and 12 deletions
+8 -3
View File
@@ -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.
+11 -9
View File
@@ -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()