Skip to content

Commit

Permalink
Configuration - Refactor MinGW build workflow to enable GCC and Clang…
Browse files Browse the repository at this point in the history
… configurations and adjust build steps
  • Loading branch information
dpasukhi committed Jan 12, 2025
1 parent 43ef4f4 commit 1beb22f
Showing 1 changed file with 46 additions and 51 deletions.
97 changes: 46 additions & 51 deletions .github/workflows/build-multiconfig-mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ jobs:
strategy:
matrix:
config:
# - {
# name: "GCC",
# cc: "x86_64-w64-mingw32-gcc",
# cxx: "x86_64-w64-mingw32-g++",
# package: "mingw-w64-x86_64-toolchain",
# thirdparty_dir: "/mingw64",
# dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-vtk mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
# }
# - {
# name: "Clang",
# cc: "clang",
# cxx: "clang++",
# package: "mingw-w64-clang-x86_64-toolchain",
# thirdparty_dir: "/clang64",
# dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-vtk mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
# }
- {
name: "GCC",
cc: "x86_64-w64-mingw32-gcc",
cxx: "x86_64-w64-mingw32-g++",
package: "mingw-w64-x86_64-toolchain",
thirdparty_dir: "/mingw64",
dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
package: "mingw-w64-clang-x86_64-toolchain",
thirdparty_dir: "/clang64",
dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
- {
name: "UCRT",
cc: "x86_64-w64-mingw32-gcc",
cxx: "x86_64-w64-mingw32-g++",
package: "mingw-w64-ucrt-x86_64-toolchain",
thirdparty_dir: "/ucrt64",
dependencies: "mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-gcc-libs mingw-w64-ucrt-x86_64-omp mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-rapidjson mingw-w64-ucrt-x86_64-freetype mingw-w64-ucrt-x86_64-draco mingw-w64-ucrt-x86_64-freeimage mingw-w64-ucrt-x86_64-tbb mingw-w64-ucrt-x86_64-tk mingw-w64-ucrt-x86_64-tcl mingw-w64-ucrt-x86_64-vtk mingw-w64-ucrt-x86_64-openvr mingw-w64-ucrt-x86_64-jemalloc mingw-w64-ucrt-x86_64-mesa mingw-w64-ucrt-x86_64-angleproject mingw-w64-ucrt-x86_64-llvm-openmp mingw-w64-ucrt-x86_64-winpthreads-git mingw-w64-ucrt-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
dependencies: "mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-gcc-libs mingw-w64-ucrt-x86_64-omp mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-rapidjson mingw-w64-ucrt-x86_64-freetype mingw-w64-ucrt-x86_64-draco mingw-w64-ucrt-x86_64-freeimage mingw-w64-ucrt-x86_64-tbb mingw-w64-ucrt-x86_64-tk mingw-w64-ucrt-x86_64-tcl mingw-w64-ucrt-x86_64-openvr mingw-w64-ucrt-x86_64-jemalloc mingw-w64-ucrt-x86_64-mesa mingw-w64-ucrt-x86_64-angleproject mingw-w64-ucrt-x86_64-llvm-openmp mingw-w64-ucrt-x86_64-winpthreads-git mingw-w64-ucrt-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}

steps:
Expand All @@ -71,28 +71,28 @@ jobs:
echo "$MSYSTEM_PREFIX/bin" >> $GITHUB_PATH
echo "CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX" >> $GITHUB_ENV
# - name: Configure basic
# shell: msys2 {0}
# run: |
# mkdir -p build
# cd build
# cmake -G "Ninja" \
# -D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
# -D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
# -D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
# -D CMAKE_CXX_FLAGS="-Wall -Wextra" \
# -D CMAKE_C_FLAGS="-Wall -Wextra" ..

# - name: Build basic
# shell: msys2 {0}
# run: |
# cd build
# cmake --build . -- -j 4

# - name: Clear up after build
# shell: pwsh
# run: |
# Remove-Item -Recurse -Force build
- name: Configure basic
shell: msys2 {0}
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D CMAKE_CXX_FLAGS="-Wall -Wextra" \
-D CMAKE_C_FLAGS="-Wall -Wextra" ..
- name: Build basic
shell: msys2 {0}
run: |
cd build
cmake --build . -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
- name: Configure full shared
shell: msys2 {0}
Expand All @@ -117,23 +117,18 @@ jobs:
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=ON \
-D USE_VTK=OFF \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
-D OpenMP_C_FLAGS="-fopenmp" \
-D OpenMP_CXX_FLAGS="-fopenmp" \
-D OpenMP_C_LIB_NAMES="gomp" \
-D OpenMP_CXX_LIB_NAMES="gomp" \
-D OpenMP_gomp_LIBRARY="$MSYSTEM_PREFIX/lib/libgomp.dll.a" \
-D CMAKE_CXX_FLAGS="-Wall -Wextra -fopenmp" \
-D CMAKE_C_FLAGS="-Wall -Wextra -fopenmp" ..
-D CMAKE_CXX_FLAGS="-Wall -Wextra" \
-D CMAKE_C_FLAGS="-Wall -Wextra" ..
- name: Build full shared
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config Debug -- -j 4
cmake --build . --target install --config Debug -- -j 0
- name: Clear up after build
shell: pwsh
Expand Down Expand Up @@ -175,7 +170,7 @@ jobs:
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config Debug -- -j 4
cmake --build . --target install --config Debug -- -j 0
- name: Clear up after build
shell: pwsh
Expand Down Expand Up @@ -206,7 +201,7 @@ jobs:
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=ON \
-D USE_VTK=OFF \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON ..
Expand All @@ -215,7 +210,7 @@ jobs:
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config Debug -- -j 4
cmake --build . --target install --config Debug -- -j 0
- name: Clear up after build
shell: pwsh
Expand Down

0 comments on commit 1beb22f

Please sign in to comment.