Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI & cmake changes #263

Merged
merged 21 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,109 @@ jobs:
name: oqs-provider-msvc
path: D:/a/oqs-provider/oqs-provider/_build/lib/oqsprovider.dll

msvc_native:
# Run a job for each of the specified target architectures:
strategy:
matrix:
os:
- windows-2019
- windows-2022
platform:
- arch: win64
oqsconfig: -DOQS_ALGS_ENABLED=STD
osslconfig: no-shared no-fips VC-WIN64A
toolchain:
# - .CMake/toolchain_windows_x86.cmake
- .CMake/toolchain_windows_amd64.cmake
msarch:
- x64
# - arm64
baentsch marked this conversation as resolved.
Show resolved Hide resolved
# - x86
runs-on: ${{matrix.os}}
steps:
- name: Restore native OpenSSL32 cache
id: cache-openssl32n
uses: actions/cache@v3
with:
path: c:\openssl32n
key: ${{ runner.os }}-msvcopenssl32n
- uses: actions/checkout@v3
- name: Checkout OpenSSL master
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
set-safe-directory: true
repository: openssl/openssl
path: openssl
- uses: actions/checkout@v3
with:
set-safe-directory: true
repository: qnfm/liboqs
path: liboqs
ref: cmake_vs
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.platform.arch }}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
with:
msbuild-architecture: ${{matrix.msarch}}
vs-version: '[16.10,]'
#Only windows 2022 image equiped with msvc of 17 version, build liboqs againt version 16 msvc will fail.
- name: Setup nasm for OpenSSL build
uses: ilammy/setup-nasm@v1
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
with:
platform: ${{ matrix.platform.arch }}
- name: Setup perl for OpenSSL build
uses: shogo82148/actions-setup-perl@v1
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
- name: build liboqs
run: |
cmake --version
cmake -B build --toolchain ${{ matrix.toolchain }} .
cmake --build build
cmake --build build --target INSTALL
working-directory: liboqs
- name: prepare the OpenSSL build directory
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
run: mkdir _build
working-directory: openssl
- name: OpenSSL config
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
working-directory: openssl\_build
run: |
perl ..\Configure --banner=Configured --prefix=c:\openssl32n no-makedepend ${{ matrix.platform.osslconfig }}
perl configdata.pm --dump
- name: OpenSSL build
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
working-directory: openssl\_build
run: nmake /S
- name: OpenSSL install
# Run on 64 bit only as 32 bit is slow enough already
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
run: |
mkdir c:\openssl32n
nmake install_sw
working-directory: openssl\_build
- name: Save OpenSSL
id: cache-openssl-save
if: steps.cache-openssl32n.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
c:\openssl32n
key: ${{ runner.os }}-msvcopenssl32n
- name: build oqs-provider
run: |
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="/wd5105" -DOPENSSL_ROOT_DIR="c:\openssl32n" -Dliboqs_DIR="c:\liboqs\lib\cmake\liboqs" -S . -B _build
cmake --build _build
- name: Run tests
run: |
ctest --test-dir _build -C Debug
- name: Retain oqsprovider.dll
uses: actions/upload-artifact@v3
with:
name: oqs-provider-msvc
path: D:/a/oqs-provider/oqs-provider/_build/lib/oqsprovider.dll

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if(MSVC)
"${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT")
add_definitions(-DOQS_PROVIDER_NOATOMIC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
set(OQS_ADDL_SOCKET_LIBS "ws2_32.lib gdi32.lib crypt32.lib")
set(OQS_ADDL_SOCKET_LIBS ws2_32.lib gdi32.lib crypt32.lib)
else()
add_compile_options(-Wunused-function)
set(OQS_ADDL_SOCKET_LIBS "")
Expand Down
4 changes: 4 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
include(GNUInstallDirs)
if (CMAKE_GENERATOR MATCHES "Visual Studio")
set(OQS_PROV_BINARY_DIR ${CMAKE_BINARY_DIR}/lib/Debug)
baentsch marked this conversation as resolved.
Show resolved Hide resolved
else()
set(OQS_PROV_BINARY_DIR ${CMAKE_BINARY_DIR}/lib)
endif()

add_test(
NAME oqs_signatures
Expand Down