remove unused requires #106
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build MinGW-w64 | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build-mingw: | |
# note that x86_64-w64-mingw32 is an alias for x86_64-pc-windows-gnu | |
# x86_64-w64-mingw32 is the toolchain name to compile to x86_64-pc-windows-gnu | |
name: Building for ${{ matrix.target_host.toolchain }} (${{ matrix.build_type }}) with mingw-w64-${{ matrix.compiler.c }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: | |
- c: gcc | |
cxx: g++ | |
target_host: | |
- toolchain: x86_64-w64-mingw32 | |
arch: x86_64 | |
cflags: -Wa,-mbig-obj | |
cxxflags: -Wa,-mbig-obj | |
ldflags: | |
- toolchain: i686-w64-mingw32 | |
arch: i686 | |
cflags: -fuse-linker-plugin -flto -Wl,-allow-multiple-definition | |
cxxflags: -fuse-linker-plugin -flto -Wl,-allow-multiple-definition | |
ldflags: -fuse-linker-plugin -flto -Wl,-allow-multiple-definition | |
build_type: | |
- Release | |
- Debug | |
steps: | |
- name: Install build tools | |
run: | | |
set -e; | |
sudo apt-get update; | |
sudo apt-get install -y cmake ninja-build python3-pip mingw-w64; | |
- uses: actions/checkout@v2 | |
- uses: hendrikmuhs/ccache-action@v1 | |
- name: Install Conan | |
run: pip install --upgrade conan | |
- name: Cache Conan Packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.conan/data | |
key: ${{ matrix.target_host.toolchain }}_${{ matrix.compiler.c }}_${{ matrix.build_type }}_conan | |
- name: Configure & Build Tools | |
run: | | |
set -e | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
cmake -S tools/ -B build/tools-build/ -DCMAKE_BUILD_TYPE=Release | |
cmake --build build/tools-build/ --parallel | |
exec cmake --install build/tools-build/ --prefix build/tools-install/ | |
- name: Configure | |
env: | |
CONAN_BASH_PATH: sh | |
CONAN_CMAKE_FIND_ROOT_PATH: /usr/${{ matrix.target_host.toolchain }} | |
CONAN_CMAKE_SYSROOT: /usr/${{ matrix.target_host.toolchain }} | |
CONAN_CMAKE_SYSTEM_NAME: Windows | |
CONAN_CMAKE_SYSTEM_PROCESSOR: ${{ matrix.target_host.arch }} | |
CHOST: ${{ matrix.target_host.toolchain }} | |
AR: ${{ matrix.target_host.toolchain }}-ar | |
AS: ${{ matrix.target_host.toolchain }}-as | |
RANLIB: ${{ matrix.target_host.toolchain }}-ranlib | |
CC: ${{ matrix.target_host.toolchain }}-${{ matrix.compiler.c }}-posix | |
CXX: ${{ matrix.target_host.toolchain }}-${{ matrix.compiler.cxx }}-posix | |
STRIP: ${{ matrix.target_host.toolchain }}-strip | |
RC: ${{ matrix.target_host.toolchain }}-windres | |
LDFLAGS: ${{ matrix.target_host.ldflags }} -static-libgcc -static-libstdc++ -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive | |
CFLAGS: ${{ matrix.target_host.cflags }} | |
CXXFLAGS: ${{ matrix.target_host.cxxflags }} | |
run: | | |
export PATH="/usr/lib/ccache/bin:/usr/local/opt/ccache/libexec:build/tools-install/bin:$PATH" | |
exec cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.target_host.arch }} -DCMAKE_FIND_ROOT_PATH=/usr/${{ matrix.target_host.toolchain }} -DCMAKE_SYSROOT=/usr/${{ matrix.target_host.toolchain }} | |
- name: Build | |
run: cmake --build build --parallel |