Skip to content

Commit

Permalink
MinGW
Browse files Browse the repository at this point in the history
  • Loading branch information
beutlich committed Jan 5, 2025
1 parent d6d6bea commit 8f121a8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 15 deletions.
45 changes: 35 additions & 10 deletions .github/workflows/checkCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defaults:
shell: bash

jobs:
build:
build_linux:
name: build_${{ matrix.platform }}
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -49,6 +49,32 @@ jobs:
name: ExternData_${{ matrix.platform }}
path: ExternData/Resources/Library/${{ matrix.platform }}/*.a

build_mingw64:
name: build_mingw64
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Install HDF5
shell: pwsh
run: |
$env:PATH="$env:PATH;C:\msys64\mingw64\bin;C:\msys64\usr\bin;"
C:\msys64\usr\bin\pacman.exe -Syu --noconfirm
C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-hdf5 mingw-w64-x86_64-pkgconf
- name: Build with gcc
shell: pwsh
run: |
$env:PATH="$env:PATH;C:\msys64\mingw64\bin;C:\msys64\usr\bin;"
pushd ExternData/Resources/C-Sources
mingw32-make CFLAGS="-O3 -DNDEBUG -I/C:\msys64\mingw64\lib" TARGETDIR="mingw64"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ExternData_mingw64
path: ExternData/Resources/Library/mingw64/*.a

test:
name: test_cmake_${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
Expand All @@ -57,18 +83,10 @@ jobs:
fail-fast: false
matrix:
toolchain:
- linux-gcc
- windows-msvc
- windows-mingw
configuration:
- Release
include:
- toolchain: linux-gcc
os: ubuntu-latest
compiler: gcc
- toolchain: windows-msvc
os: windows-latest
compiler: msvc
- toolchain: windows-mingw
os: windows-latest
compiler: mingw
Expand All @@ -77,12 +95,19 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Install HDF5
if: matrix.compiler == 'mingw'
shell: pwsh
run: |
$env:PATH="$env:PATH;C:\msys64\mingw64\bin;C:\msys64\usr\bin;"
C:\msys64\usr\bin\pacman.exe -Syu --noconfirm
C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-hdf5 mingw-w64-x86_64-pkgconf
- name: Configure
run: |
if [ "${{ matrix.compiler }}" == "msvc" ]; then
cmake -S "$SRCDIR" -B build
elif [ "${{ matrix.compiler }}" == "mingw" ]; then
cmake -S "$SRCDIR" -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -G "MinGW Makefiles"
cmake -S "$SRCDIR" -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_EXE_LINKER_FLAGS="-L/C:\msys64\mingw64\lib" -G "MinGW Makefiles"
else
cmake -S "$SRCDIR" -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_C_FLAGS="-Wall -Wextra"
fi
Expand Down
5 changes: 0 additions & 5 deletions ExternData/Resources/BuildProjects/CMake/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ if(EXISTS "${ED_TEST_DIR}")
Test_ED_XML
Test_ED_XML2
)
if(MINGW)
list(REMOVE_ITEM ED_TESTS Test_ED_MAT)
endif()
foreach(TEST ${ED_TESTS})
add_executable(${TEST}
"${ED_TEST_DIR}/${TEST}.cc"
Expand Down Expand Up @@ -75,8 +72,6 @@ if(EXISTS "${ED_TEST_DIR}")
)
if(UNIX)
list(APPEND ED_ALL_LIBS m)
elseif(MINGW)
list(REMOVE_ITEM ED_ALL_LIBS hdf5)
endif()
target_link_libraries(${TEST} PRIVATE ${ED_ALL_LIBS})

Expand Down

0 comments on commit 8f121a8

Please sign in to comment.