@@ -2,11 +2,9 @@ name: CMake on multiple platforms
22
33on :
44 push :
5- branches :
6- - main
7- - adaptiveDt
5+ branches : [ main, adaptiveDt ]
86 pull_request :
9- branches : [ " main" ]
7+ branches : [ main ]
108
119jobs :
1210 build :
2422 c_compiler : cl
2523 cpp_compiler : cl
2624
27- # Windows GCC ( MinGW)
25+ # Windows MinGW
2826 - os : windows-latest
2927 c_compiler : gcc
3028 cpp_compiler : g++
4543 c_compiler : clang
4644 cpp_compiler : clang++
4745
48- # macOS (Homebrew LLVM for OpenMP)
46+ # macOS
4947 - os : macos-latest
5048 c_compiler : clang
5149 cpp_compiler : clang++
6664 - uses : actions/checkout@v4
6765
6866 # ------------------------
69- # Install OpenMP + HDF5
67+ # Install dependencies
7068 # ------------------------
7169
7270 - name : Install OpenMP + HDF5 (Ubuntu)
@@ -81,28 +79,21 @@ jobs:
8179 brew update
8280 brew install llvm libomp hdf5
8381
84- # ------------------------
85- # FIXED: Proper MinGW HDF5 install
86- # ------------------------
8782 - name : Install MinGW + HDF5 (Windows GCC)
8883 if : matrix.os == 'windows-latest' && matrix.c_compiler == 'gcc'
8984 shell : bash
9085 run : |
9186 choco install msys2 -y
9287 C:/tools/msys64/usr/bin/pacman -Syu --noconfirm
9388 C:/tools/msys64/usr/bin/pacman -S --noconfirm mingw-w64-x86_64-hdf5
94- echo "Using MSYS2 MinGW HDF5"
9589
96- # ------------------------
97- # MSVC stays the same
98- # ------------------------
9990 - name : Install HDF5 (Windows MSVC)
10091 if : matrix.os == 'windows-latest' && matrix.c_compiler == 'cl'
10192 run : |
10293 vcpkg install hdf5
10394
10495 # ------------------------
105- # Set reusable strings
96+ # Set build directory
10697 # ------------------------
10798 - name : Set reusable strings
10899 id : strings
@@ -113,6 +104,8 @@ jobs:
113104 # ------------------------
114105 # Configure CMake
115106 # ------------------------
107+
108+ # macOS (LLVM)
116109 - name : Configure CMake (macOS)
117110 if : matrix.os == 'macos-latest'
118111 run : >
@@ -122,19 +115,37 @@ jobs:
122115 -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang
123116 -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++
124117 -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/llvm;/opt/homebrew/opt/hdf5"
125- -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp"
126- -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp"
127- -DOpenMP_C_LIB_NAMES="omp"
128- -DOpenMP_CXX_LIB_NAMES="omp"
129- -DOpenMP_omp_LIBRARY=/opt/homebrew/opt/libomp/lib/libomp.dylib
130-
131- - name : Configure CMake (Others)
132- if : matrix.os != 'macos-latest'
118+
119+ # Windows MinGW
120+ - name : Configure CMake (Windows MinGW)
121+ if : matrix.os == 'windows-latest' && matrix.c_compiler == 'gcc'
122+ shell : bash
123+ run : >
124+ cmake -G "MinGW Makefiles"
125+ -B ${{ steps.strings.outputs.build-output-dir }}
126+ -S ${{ github.workspace }}
127+ -DCMAKE_C_COMPILER=gcc
128+ -DCMAKE_CXX_COMPILER=g++
129+ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
130+
131+ # Windows MSVC
132+ - name : Configure CMake (Windows MSVC)
133+ if : matrix.os == 'windows-latest' && matrix.c_compiler == 'cl'
134+ run : >
135+ cmake -G "Visual Studio 17 2022"
136+ -B ${{ steps.strings.outputs.build-output-dir }}
137+ -S ${{ github.workspace }}
138+ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
139+ -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
140+
141+ # Linux (Ubuntu)
142+ - name : Configure CMake (Linux)
143+ if : startsWith(matrix.os, 'ubuntu')
133144 run : >
134145 cmake -B ${{ steps.strings.outputs.build-output-dir }}
135146 -S ${{ github.workspace }}
136- -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
137147 -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
148+ -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
138149 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
139150
140151 # ------------------------
@@ -151,7 +162,7 @@ jobs:
151162 run : ctest --build-config ${{ matrix.build_type }}
152163
153164 # ------------------------
154- # Upload build artifacts
165+ # Upload artifacts
155166 # ------------------------
156167 - name : Upload binaries
157168 uses : actions/upload-artifact@v4
0 commit comments