Skip to content

Commit

Permalink
Fix bug in cross-compilation for Windows; update CI (#1696)
Browse files Browse the repository at this point in the history
  • Loading branch information
SWilson4 authored Feb 13, 2024
1 parent f371848 commit ac164b4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
33 changes: 27 additions & 6 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Ensure code conventions are upheld
run: python3 -m pytest --verbose tests/test_code_conventions.py
- name: Check that doxygen can parse the documentation
Expand All @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Verify copy_from_upstream state
run: |
git config --global user.name "ciuser" && \
Expand All @@ -46,7 +46,7 @@ jobs:
SIG_NAME: dilithium_3
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Configure
run: |
mkdir build && \
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
image: ${{ matrix.container }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Configure
run: mkdir build && cd build && cmake -GNinja ${{ matrix.CMAKE_ARGS }} .. && cmake -LA ..
- name: Build
Expand All @@ -118,7 +118,7 @@ jobs:
path: build/*.deb

linux_arm_emulated:
needs: [stylecheck, buildcheck]
needs: [stylecheck, upstreamcheck, buildcheck]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -134,7 +134,7 @@ jobs:
# CMAKE_ARGS: -DOQS_ENABLE_SIG_SPHINCS=OFF -DOQS_USE_OPENSSL=OFF -DOQS_OPT_TARGET=generic
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install the emulation handlers
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- name: Build in an x86_64 container
Expand All @@ -160,3 +160,24 @@ jobs:
python3 -m pytest --verbose \
--numprocesses=auto \
--ignore=tests/test_code_conventions.py ${{ matrix.PYTEST_ARGS }}"
linux_cross_compile:
needs: [stylecheck, upstreamcheck, buildcheck]
runs-on: ubuntu-latest
container: openquantumsafe/ci-ubuntu-focal-x86_64:latest
strategy:
fail-fast: false
matrix:
include:
- name: windows-binaries
CMAKE_ARGS: -DCMAKE_TOOLCHAIN_FILE=../.CMake/toolchain_windows-amd64.cmake
- name: windows-dll
CMAKE_ARGS: -DCMAKE_TOOLCHAIN_FILE=../.CMake/toolchain_windows-amd64.cmake -DBUILD_SHARED_LIBS=ON
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure
run: mkdir build && cd build && cmake -GNinja ${{ matrix.CMAKE_ARGS }} .. && cmake -LA ..
- name: Build
run: ninja
working-directory: build
5 changes: 4 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ add_library(oqs kem/kem.c
# Internal library to be used only by test programs
add_library(oqs-internal ${INTERNAL_OBJS})

set(COMMON_OBJS ${COMMON_OBJS} PARENT_SCOPE)
if(DEFINED SANITIZER_LD_FLAGS)
target_link_libraries(oqs PUBLIC ${SANITIZER_LD_FLAGS})
target_link_libraries(oqs-internal PUBLIC ${SANITIZER_LD_FLAGS})
Expand All @@ -79,6 +78,10 @@ target_include_directories(oqs-internal
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)

if(MINGW)
target_link_options(oqs-internal PRIVATE -Wl,--export-all-symbols)
endif()

set_target_properties(oqs
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
Expand Down

0 comments on commit ac164b4

Please sign in to comment.